if($(".wel-banner .wb2 .swiper-slide").length >1){ var bannerdian = new Swiper('.welbanner-pagination .swiper-container', { pagination : '.welbanner-pagination .swiper-pagination', paginationClickable: true, slidesPerView: 'auto', spaceBetween: 0, initialSlide:0, speed:600, autoplay : 6000, paginationClickable: true, // loop:true, slideToClickedSlide:true, autoplayDisableOnInteraction: false, lazyLoading : true, lazyLoadingInPrevNext : true, roundLengths : true, uniqueNavElements :false, noSwiping : true, direction: 'vertical', mousewheelControl: true, onInit:function(swiper){ } }) var banner = new Swiper('.wel-banner .swiper-container.wb2', { prevButton:'.wel-banner .swiper-button-prev', nextButton:'.wel-banner .swiper-button-next', pagination : '.wel-banner .swiper-pagination', paginationClickable: true, centeredSlides: true, slidesPerView: 1, spaceBetween: 0, initialSlide:0, speed:600, effect:'fade', autoplay : 6000, paginationClickable: true, // loop:true, slideToClickedSlide:true, autoplayDisableOnInteraction: false, lazyLoading : true, lazyLoadingInPrevNext : true, roundLengths : true, uniqueNavElements :false, noSwiping : true, onInit: function(swiper){ $(".wel-banner .secwen").removeClass('animate'); setTimeout(function(){ $(".wel-banner .wb2 .swiper-slide-active .secwen").addClass('animate'); },100) var activeIndex = swiper.activeIndex; bannerdian.slideTo(activeIndex,1000,false) var videoIndex = $('.wel-banner .wb2 .swiper-slide-active.videoboxs').index(); // var activeIndex = $('.wel-banner .wb2 .swiper-slide-active').data('swiper-slide-index'); var banLen = $('.wel-banner .wb2 .swiper-slide').length; $(".welbanner-pagination .li").eq(activeIndex).addClass("active").siblings().removeClass("active"); if(banLen==1){ swiper.stopAutoplay(); } if(videoIndex == activeIndex){ swiper.stopAutoplay(); $(".wel-banner .wb2 .swiper-slide-active.videoboxs").find("video")[0].load(); $(".wel-banner .wb2 .swiper-slide-active.videoboxs").find("video")[0].play(); } if($('.wel-banner .videoboxs').length>0){ $('.wel-banner .wb2 .swiper-slide-active.videoboxs video').on('ended',function(){ setTimeout(function(){ swiper.slideNext(); swiper.startAutoplay(); swiper.params.autoplay = 6000; },500) }) } }, onTransitionStart: function(swiper){ $(".wel-banner .secwen").removeClass('animate'); setTimeout(function(){ $(".wel-banner .wb2 .swiper-slide-active .secwen").addClass('animate'); },100) var activeIndex = swiper.activeIndex; bannerdian.slideTo(activeIndex,1000,false) var videoIndex = $('.wel-banner .wb2 .swiper-slide-active.videoboxs').index(); // var activeIndex = $('.wel-banner .wb2 .swiper-slide-active').data('swiper-slide-index'); $(".welbanner-pagination .li").eq(activeIndex).addClass("active").siblings().removeClass("active"); if(videoIndex == activeIndex){ $('.wel-banner .wb2 .swiper-slide-active video')[0].play(); swiper.stopAutoplay(); } if($('.wel-banner .videoboxs').length>0){ $('.swiper-slide-active.videoboxs video').on('ended',function(){ setTimeout(function(){ swiper.slideNext(); swiper.startAutoplay(); swiper.params.autoplay = 6000; },500) }) } var index = $(".wel-banner .wb2 .swiper-slide-active").attr("data-swiper-slide-index") if(index == 0 || index ==1){ } } }) $(".welbanner-pagination .li").on("click",function(){ $(".wel-banner .secwen").removeClass('animate'); setTimeout(function(){ $(".wel-banner .wb2 .swiper-slide-active .secwen").addClass('animate'); },100) $(this).addClass("active").siblings().removeClass("active"); var index = $(this).index(); banner.slideTo(index,1000,false); }) // $(".welbanner-pagination .li").eq(0).click(); }else{ $(".wel-banner .secwen").addClass('animate'); } if($(window).innerWidth()<1024){ $(".wel-banner video").attr("scr",""); } var welpro = new Swiper('.home-products-list .swiper-container',{ pagination : '.home-products-list .swiper-pagination', prevButton:'.home-products-list .swiper-button-prev', nextButton:'.home-products-list .swiper-button-next', effect:'fade', autoplay:5000, slidesPerView: "auto", paginationClickable: true, autoplayDisableOnInteraction: false, lazyLoadingInPrevNext : true, roundLengths : true, uniqueNavElements :false, autoHeight: false, noSwiping : true, // loop:true, speed:750, onInit: function(swiper){ $(".home-products-list .secwen").removeClass('animate'); setTimeout(function(){ $(".home-products-list .swiper-slide-active .secwen").addClass('animate'); },100) var i = $(".home-products-list .items.swiper-slide-active").index(); $(".home-products-list .welpro-titles .li").eq(i).addClass("active").siblings().removeClass("active"); }, onTransitionStart: function(swiper){ $(".home-products-list .secwen").removeClass('animate'); setTimeout(function(){ $(".home-products-list .swiper-slide-active .secwen").addClass('animate'); },100) var i = $(".home-products-list .items.swiper-slide-active").index(); $(".home-products-list .welpro-titles .li").eq(i).addClass("active").siblings().removeClass("active"); } }) $(".home-products-list .welpro-titles .li span").on("click",function(){ $(this).parents(".li").addClass("active").siblings().removeClass("active"); var index = $(this).parents(".li").index(); welpro.slideTo(index,1000,false) $(".home-products-list .secwen").removeClass('animate'); setTimeout(function(){ $(".home-products-list .swiper-slide-active .secwen").addClass('animate'); },100) }) $(".home-products-list .welpro-titles .li").eq(0).find("span").click();