$(window).scroll(function(){ var p=0,t=0; p=document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; if(t

0) { t = p; $('.header_main').addClass('fixed-top'); $('.header_main').fadeIn(300); $('.goTop').show(); } else { $('.header_main').removeClass('fixed-top'); $('.goTop').hide(); } }); $(function () { new WOW().init(); $('.index-about-wrap .num').countUp({ delay: 10, time: 2000 }); $('[data-toggle="offcanvas"]').on('click', function () { $('.offcanvas').toggleClass('show'); $('.header_main').removeClass('fixed-top'); $('body').css('overflow-y','hidden'); }); $('.offcanvas-header .btn-close').on('click',function(){ $('.offcanvas').toggleClass('show'); $('.header_main').addClass('fixed-top'); $('body').css('overflow-y','auto'); }); if(isMobile!=='1') { $('#newsTabs').find('.nav-link').on('mouseover',function(){ $('#newsTabs').find('.nav-link').removeClass('active'); $(this).addClass('active'); var target=($(this).attr('href')) $('#index-pills-tabcontent').find('.tab-pane').removeClass('active'); $(target).addClass('active'); }); } $('.goTop a').on('click',function(){ $('html,body').animate({scrollTop:0},1000); }); }) $(function(){ var categorySwiper = new Swiper(".product-category-swiper", { spaceBetween: 10, slidesPerView: 4, freeMode: true, watchSlidesProgress: true, grabCursor: true, breakpoints: { 640: { slidesPerView: 3, spaceBetween: 20, }, 768: { slidesPerView: 4, spaceBetween: 30, }, 1024: { slidesPerView: 5, spaceBetween: 50, }, 1200: { slidesPerView: 7, spaceBetween: 50, }, }, }); var indexProductSwiper = new Swiper(".indexProductSwiper", { spaceBetween: 10, thumbs: { swiper: categorySwiper, }, lazy: { loadPrevNext: true, }, navigation: { nextEl: ".swiper-button-next", prevEl: ".swiper-button-prev", }, on:{ slideChange: function(){ var index = this.activeIndex; $('.product-category-swiper .swiper-slide').removeClass('active'); $('.product-category-swiper .swiper-slide').each(function(){ var defaultIcon=$(this).data('icon'); $(this).find('img').eq(0).attr('src',defaultIcon); }); var currObj=$('.product-category-swiper .swiper-slide').eq(index); var activeIcon=currObj.data('active'); currObj.addClass('active'); if(activeIcon!='' && activeIcon!=undefined) { currObj.find('img').attr('src',activeIcon); } }, }, }); $('.product-category-swiper .swiper-slide').on('mouseover',function(){ var index=$(this).index(); indexProductSwiper.slideTo(index); }); }); $(function(){ var nowTime; var banT0; //鍒ゆ柇杞挱鍥剧涓€涓槸鍚︽槸瑙嗛 var video=$('#myCarousel .carousel-item').eq(0).find('video').attr('id'); if(video!==undefined) { nowTime = $('#myCarousel .carousel-item').eq(0).attr("data-interval"); // banT0 = setTimeout(function() { $('#myCarousel').carousel('next'); }, nowTime); //鍐欎竴涓畾鏃跺櫒锛屾粴鍔ㄥ埌涓嬩竴寮燽anner鍥剧殑鏃堕棿 } $('#myCarousel').on('slide.bs.carousel', function (event) { // do something... var videoId_from=$('#myCarousel .carousel-item').eq(event.from).find('video').attr('id'); if(videoId_from!==undefined) { document.getElementById(videoId_from).load(); } var videoId=$('#myCarousel .carousel-item').eq(event.to).find('video').attr('id'); if(videoId!==undefined) { nowTime = $('#myCarousel .carousel-item').eq(event.to).attr("data-interval"); //鍒濆鍖栬幏鍙栫涓€涓棰戜笂鐨勬椂闂 banT0 = setTimeout(function() { $('#myCarousel').carousel('next'); }, nowTime - 1000); //鍐欎竴涓畾鏃跺櫒锛屾粴鍔ㄥ埌涓嬩竴寮燽anner鍥剧殑鏃堕棿 document.getElementById(videoId).play(); } }); });