var video = document.getElementById("pcvideo"); clickVideo($(".mvideo")); 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(); }) if($(".wel-banner .swiper-slide").length >1){ 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, 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); } }) }else{ $(".wel-banner .secwen").addClass('animate'); } $(".con-header .bocweb-header").on("mouseenter",function(){ $(this).parents(".con-header").removeClass("active-white"); }) $(".con-header .bocweb-header").on("mouseleave",function(){ $(this).parents(".con-header").addClass("active-white"); })