clickVideo($(".wel-banner .items .welbtns .wel-anniu")); var video = document.getElementById("pcvideo"); function vdieoresize(){ var W1= $(window).width(); var H1= $(window).height(); if ((W1/H1)>(16/9)) { $(".banner .videoboxs video").height(W1*9/16); }else{ $(".banner .videoboxs video").width(H1*16/9); } } vdieoresize(); $(window).on("resize",function(){ vdieoresize(); }) var banner = new Swiper('.wel-banner .swiper-container',{ prevButton:'.wel-banner .swiper-button-prev', nextButton:'.wel-banner .swiper-button-next', pagination : '.wel-banner .banbtns', paginationClickable: true, centeredSlides: true, slidesPerView: 1, spaceBetween: 0, initialSlide:0, speed:600, autoplay : 6000, // effect:"fade", loop:true, slideToClickedSlide:true, autoplayDisableOnInteraction: false, lazyLoading : true, lazyLoadingInPrevNext : true, roundLengths : true, uniqueNavElements :false, paginationBulletRender: function (swiper, index, className) { return '' + '
'+ ''+ ''+ '' +'' +'
' + '
'; }, onTransitionEnd: function() { delay = 4000; anime({//用animejs画圈 targets: '.path-loop', delay: 300, strokeDashoffset: function(el) { var svgLength = anime.setDashoffset(el); return [svgLength, 0]; }, easing: 'linear', duration: delay, }); }, onInit:function(swiper){ $(".wel-banner .secwen").removeClass('animate'); setTimeout(function(){ $(".wel-banner .swiper-slide-active .secwen").addClass('animate'); },100) var index = swiper.activeIndex + 1; var len = $(".wel-banner .swiper-slide").length; setTimeout(function(){ if($(".wel-banner .swiper-slide-active").hasClass('videoboxs') && $(window).innerWidth() >= 1024){ swiper.stopAutoplay(); // video.load(); video.play(); video.addEventListener("ended",function () { swiper.slideNext(); }); }else{ swiper.startAutoplay(); swiper.params.autoplay = 6000; } },200); }, onImagesReady:function(){ $(".wel-banner .secwen").removeClass('animate'); setTimeout(function(){ $(".wel-banner .swiper-slide-active .secwen").addClass('animate'); },100) setTimeout(function(){ if($(".wel-banner .swiper-slide-active").hasClass('videoboxs') && $(window).innerWidth() >= 1024){ swiper.stopAutoplay(); // video.load(); video.play(); video.addEventListener("ended",function () { swiper.slideNext(); }); }else{ swiper.startAutoplay(); swiper.params.autoplay = 6000; } },200); }, onSlideChangeStart: function(swiper){ $(".wel-banner .secwen").removeClass('animate'); $(".wel-banner .swiper-slide-active .secwen").addClass('animate'); var index = swiper.activeIndex + 1; var len = $(".wel-banner .swiper-slide").length; setTimeout(function(){ if($(".wel-banner .swiper-slide-active").hasClass('videoboxs') && $(window).innerWidth() >= 1024){ swiper.stopAutoplay(); // video.load(); video.play(); video.addEventListener("ended",function () { swiper.slideNext(); }); }else{ swiper.startAutoplay(); swiper.params.autoplay = 6000; } },200); }, })