$(document).ready(function () { var scene_total = $('#app-scen').data('scene-total'); if(scene_total==3){ console.log(scene_total); if($(window).width()<=640){ }else{ $('.app-scen .list .list-one').height(450); } } // 搴旂敤鍦烘櫙鐨剆wiper var swiper_scene = new Swiper('#app-scen .list', { autoplay: true, slidesPerView: 4, spaceBetween: 20, grabCursor : true, breakpoints: { 320: { //褰撳睆骞曞搴﹀ぇ浜庣瓑浜?20 slidesPerView: 1 }, 640: { //褰撳睆骞曞搴﹀ぇ浜庣瓑浜?40 slidesPerView: 3, }, 1200: { slidesPerView: scene_total >=4 ? 4 : 3, } } }) // 瀹㈡埛妗堜緥鐨剆wiper /* var mycaseSwiper = new Swiper('#customer-case .case-left-list', { grabCursor : true, slidesPerColumn: 2, spaceBetween: 20, pagination: { el: '.swiper-pagination', clickable: true, }, breakpoints: { 320: { slidesPerView: 1, spaceBetween: 20, direction: 'horizontal', }, 640: { slidesPerView: 2, spaceBetween: 20, direction: 'horizontal', }, 1200: { slidesPerView: 2, spaceBetween: 10, direction: 'vertical', } } }); */ var mycaseSwiper = new Swiper('.case .swiper-container', { slidesPerColumn: 2, spaceBetween: 30, pagination: { el: '.swiper-pagination', clickable: true, }, breakpoints: { 320: { slidesPerView: 1, spaceBetween: 20, }, 640: { slidesPerView: 2, spaceBetween: 30, }, 1200: { slidesPerView: 2, spaceBetween: 30, } } }); /* var mycaseSwiper = new Swiper('#customer-case .case-left-list',{ grabCursor : true, slidesPerView: 2, spaceBetween: 10, breakpoints: { 320: { //褰撳睆骞曞搴﹀ぇ浜庣瓑浜?20 direction: 'horizontal', }, 768: { //褰撳睆骞曞搴﹀ぇ浜庣瓑浜?68 direction: 'vertical', spaceBetween: 15, }, }, }) */ var caseImglist = new Swiper("#customer-case .image",{ autoplay: true, grabCursor: true, }) $('.customer-case .case-card').hover(function(){ var img = $(this).data('img'); var link = $(this).data('link'); if(link!=''){ $('.case .bg-img').attr("onclick","location.href='"+link+"'"); }else{ $('.case .bg-img').removeAttr("onclick"); } $('.case .bg-img').css({"opacity":"0.5","background-image":'url('+img+')'}).animate({opacity:'1'},1000); }); hideTop() clickSecNav(); clickProTypeBtn(); clickAppScenCard() }); function hideTop() { //褰撴粦鍔ㄥ埌浜岀骇瀵艰埅鏃跺奖钘忓ご閮ㄥ皢浜岀骇瀵艰埅缃《 var rbanner=$('#robot-page .banner').height() console.log(rbanner) $(document).scroll(function(){ var scroH = $(document).scrollTop(); if(scroH>rbanner){ $('header').css({ 'display':'none' }) $('.sec-nav').css({ 'position':'fixed', 'left':0, 'top':0 }) }else{ $('header').css({ 'display':'flex' }) $('.sec-nav').css({ 'position':'relative', 'left':0, 'top':0 }) } }) } function clickSecNav(){ //鐐瑰嚮鏈哄櫒浜洪〉闈㈢殑浜岀骇瀵艰埅 var slip = $('.sec-nav .sec-nav-slip'); var a = $('#robot-page > div.sec-nav > div > a:nth-child(1)'); console.log(a) //鍒濆鍖栨粦鍧 // slip.css({ // // 'width': a.width() *0.1, // left: parseInt(a.position().left) +a.width()*0.5- slip.width()*0.5 + 'px' // }); $('#robot-page > div.sec-nav > div > a').click(function () { //鏄剧ず婊戝潡 if (slip.css('display') == 'none') { slip.show(); }; //绉诲姩婊戝潡 slip.stop().animate({ // width: $(this).width() *0.5, left: parseInt($(this).position().left) +$(this).width()*0.5- slip.width()*0.5 + 'px' }, 300); // 骞虫粦绉诲姩 $('html, body').animate({ scrollTop: $($.attr(this, 'href')).offset().top-50 }, 500); }); }; function clickProTypeBtn(){ //鐐瑰嚮浜у搧绫诲瀷涓や釜鎸夐挳 //鍒濆鍖栭€夋嫨绗竴涓寜閽 $('.product-type .type-top .top-btn:first').addClass('active') $('.product-type .type-top .top-btn').click(function(){ $(this).addClass('active') $(this).siblings().removeClass("active"); }) }; function clickAppScenCard(){ //鐐瑰嚮瀹㈡埛妗堜緥灏忓崱鐗 $('#customer-case .case-card').hover(function(){ console.log($(this).children()[0]); $(this).addClass('bg-active') $(this).siblings().removeClass('bg-active') $(this).children().addClass('text-active') $(this).siblings().children().removeClass('text-active'); var img = $(this).attr('data-img'); var link = $(this).attr('data-link'); $('#case-img').css({"background-image":"url('"+img+"')"}); $('#case-img').attr("onclick","location.href='"+link+"'"); }) } function getProductParams(id){ var str = ''; $.getJSON('/index.php?m=product&c=api&a=params&id='+id,function(res){ if(res.state=='1'){ str += '
'; str += '

'+res.data.title+'

'; str += '
'; $.each(res.data.params,function(k,v){ str += ''; }); str += '
鍙傛暟鍊稽/th>
'+v.key+''+v.value+'
'; str += '
'; $('#mask').addClass('viewed'); $('#layer').html(str).fadeIn().addClass('paramLayer'); }else{ alert(res.msg); } }); } function showLayerVideo(src){ var str = '