window.addEventListener('resize',setStyle) $(function () { $(window).on("load",function(){ $("#contentX").mCustomScrollbar({ axis:"x", theme:"light-3", autoExpandScrollbar:true, advanced:{autoExpandHorizontalScroll:true} }); }); changeBanner(); $(window).on('resize', function(){ changeBanner() }) function changeBanner(){ if(window.innerWidth<768){ $('.swiper-container').eq(1).removeClass('hidden').siblings().addClass('hidden'); }else{ $('.swiper-container').eq(0).removeClass('hidden').siblings().addClass('hidden'); } } //banner var banner_swiper = new Swiper('.banner .swiper-container',{ speed:1000, loop:true, autoplay: { delay: 10000, stopOnLastSlide: false, disableOnInteraction: false, }, pagination: { el: '.banner .swiper-pagination', clickable: true, renderBullet: function (index, className) { return '' + ((index + 1)) + ''; }, }, }); $('.scl-innernav-tab').each(function(i,el){ var elem = $(el) window['productSwiper'+i] = new Swiper(elem, { slidesPerView: 5, loop: true, autoplay: { delay: 2000, disableOnInteraction: false }, breakpoints: { 1440: { slidesPerView: 4 }, 1024: { slidesPerView: 3 }, 768: { slidesPerView: 2 }, 500: { slidesPerView: 1 } } }) }) $('.scl-innernav-tab').each(function(i,el){ var elem = $(el) window['productSwiper'+i] = new Swiper(elem, { slidesPerView: 5, loop: true, autoplay: { delay: 2000, disableOnInteraction: false }, breakpoints: { 1440: { slidesPerView: 4 }, 1024: { slidesPerView: 3 }, 768: { slidesPerView: 2 }, 500: { slidesPerView: 1 } } }) }) //在CHINT中查找产品 切换 $('.dtfc-body .scl-innernav-tab').eq(1).addClass('on'); $('.dtfc-head li').on('mouseenter',function() { var i = $(this).index(); $(this).addClass('active').siblings().removeClass('active'); $('.dtfc-body .scl-innernav-tab').eq(i).addClass('on').siblings().removeClass('on'); }); /* 行业解决方案 */ $('.Idssolutions ul > li').hover(function(){ $(this).addClass('active').siblings().removeClass('active'); }) var swiperIdssolutions = new Swiper('.swiper-Idssolutions', { slidesPerView: 5, spaceBetween: 15, autoplay: { delay: 3000, disableOnInteraction: false, }, breakpoints: { 1200: { slidesPerView: 4, spaceBetween: 15, }, 1000: { slidesPerView: 3, spaceBetween: 15, }, 768: { slidesPerView: 2, spaceBetween: 15, }, 500: { slidesPerView: 1, spaceBetween: 10, }, } }); $('.swiper-Idssolutions').hover(function(){ swiperIdssolutions.autoplay.stop(); },function(){ swiperIdssolutions.autoplay.start(); }) //超出滚动 $(window).on("load",function(){ $(".swiper-Idssolutions .txt").mCustomScrollbar({ theme:"minimal" }); }); //无缝滚动 // $("#scl1").kxbdMarquee({direction:"left",scrollDelay:30}); // $("#scl2").kxbdMarquee({direction:"left",scrollDelay:30}); // $("#scl3").kxbdMarquee({direction:"left",scrollDelay:30}); // $("#scl4").kxbdMarquee({direction:"left",scrollDelay:30}); // $("#scl5").kxbdMarquee({direction:"left",scrollDelay:30}); // $("#scl6").kxbdMarquee({direction:"left",scrollDelay:30}); })