var banner = new Swiper('.banner .swiper-container',{ effect:"fade" }); $(".bocweb-header").on("mouseenter",function(){ $("body").addClass("botbg body-black") }) $(".bocweb-header").on("mouseleave",function(){ if($("body").hasClass("fp-viewing-0")){ $("body").removeClass("botbg body-black"); }else{ $("body").removeClass("botbg"); } }) var video = document.getElementById("pcvideo"); if($(window).innerWidth() >= 1024){ $('#fullpage').fullpage({ 'scrollingSpeed': 800, 'verticalCentered': false, 'resize':true, 'css3': true, // 'anchors':['棣栭〉', '鏂伴椈涓績', '瑙嗛涓績', '鍏充簬鍗庤寕', '浜т笟棰嗗煙', '绀句細璐d换',""], 'navigationTooltips':['棣栭〉', '鏂伴椈涓績', '瑙嗛涓績', '鍏充簬鍗庤寕', '浜т笟棰嗗煙', '绀句細璐d换',""], 'navigation': true, 'menu': '#menu', 'navigationPosition':'left', afterLoad: function(anchorLink, index){ var loadedSection = $(this); $(".welbody #fp-nav.left").show(); $(".bocweb-header").addClass("active"); $(".bocweb-header").removeClass("whitefixed"); $(".section .secwen").removeClass("active"); $("body").addClass("body-black"); if(index == 1){ $(".banner .secwen").removeClass('animate'); $(".banner .swiper-slide-active .secwen").addClass('animate'); $(".bocweb-header").removeClass("active"); $("body").removeClass("body-black"); setTimeout(function(){ if($(".banner .swiper-slide-active").hasClass('videoboxs') && $(window).innerWidth() >= 1024){ banner.stopAutoplay(); // video.load(); video.play(); video.addEventListener("ended",function () { }); }else{ banner.startAutoplay(); banner.params.autoplay = 6000; } },200); } if(index == 2){ $('.section2').addClass('animate'); $(".section2").find(".secwen").addClass("animate"); // time(); } if(index == 3){ $(".section3").find(".secwen").addClass("animate"); } if(index == 4){ $('.section4').addClass('animate'); $(".section4").find(".secwen").addClass("animate"); } if(index == 5){ $(".section5").find(".secwen").addClass("animate"); // $(".fixed-bottoms2").show(); $(".bocweb-header").addClass("whitefixed") } if(index == 6){ $(".section6").find(".secwen").addClass("animate"); }if(index == 7){ $(".welbody #fp-nav.left").hide(); } }, onLeave: function(index, nextIndex, direction){ var leavingSection = $(this); if(direction =='down' && nextIndex == 2){ $(".wel-bottoms").removeClass("on"); }; if(direction =='up' && nextIndex == 5){ // return false; } if(direction =='down' && nextIndex == 6){ $(".section5").find(".secwen").addClass("animate"); // $(".fixed-bottoms2").show(); // $(".fixed-bottoms2,#fp-nav").hide(); }else if(direction =='up' && nextIndex == 5){ $(".fixed-bottoms2,#fp-nav").show(); } } }) }else{ function scrollAni() { $('.secwen').each(function() { var _this = $(this); if (_this.offset().top > $(window).scrollTop() + $(window).height() || _this.offset().top < $(window).scrollTop() - _this.outerHeight()) { // _this.removeClass('animate'); } else if ($(window).scrollTop() > _this.offset().top - $(window).height() * 0.95) { _this.addClass('animate'); } }); $(window).scroll(function() { $('.secwen').each(function() { var _this = $(this); if (_this.offset().top > $(window).scrollTop() + $(window).height() || _this.offset().top < $(window).scrollTop() - _this.outerHeight()) { // _this.removeClass('animate'); } else if ($(window).scrollTop() > _this.offset().top - $(window).height() * 0.95) { _this.addClass('animate'); // $(_this) // startScramble('.i-img-list.animate .home-dec'); // startScramble('.i-lista.animate .home-dec'); } }); }); } scrollAni(); } var banner = new Swiper('.banner .swiper-container',{ prevButton:'.banner .swiper-button-prev', nextButton:'.banner .swiper-button-next', pagination : '.banner .swiper-pagination', paginationClickable: true, centeredSlides: true, slidesPerView: 1, spaceBetween: 0, initialSlide:0, speed:600, autoplay : 6000, effect:"fade", slideToClickedSlide:true, autoplayDisableOnInteraction: false, lazyLoading : true, lazyLoadingInPrevNext : true, roundLengths : true, onInit:function(swiper){ var index = swiper.activeIndex + 1; var len = $(".banner .swiper-slide").length; setTimeout(function(){ if($(".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(){ $(".banner .secwen").removeClass('animate'); $(".banner .swiper-slide-active .secwen").addClass('animate'); setTimeout(function(){ if($(".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){ var index = swiper.activeIndex + 1; var len = $(".banner .swiper-slide").length; setTimeout(function(){ if($(".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); }, }) // 绗竴灞 瑙嗛 function vdieoresize(){ var W1= $(window).width(); var H1= $(window).height(); if ((W1/H1)>(16/9)) { $(".section1 .videoboxs video").height(W1*9/16); }else{ $(".section1 .videoboxs video").width(H1*16/9); } } vdieoresize(); $(window).on("resize",function(){ vdieoresize(); }) function banner_video(){ $(".banner .secwen").removeClass('animate'); $(".banner .swiper-slide-active .secwen").addClass('animate'); setTimeout(function(){ if($(".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); } function time(){ var _b=true; var options = { useEasing: true, useGrouping: true, separator: '', decimal: '.' }; if($(".wel-section2 .items4 .lists.add5 .li").eq(0).find(".tits").text()!= 0){ return; } if($(".section2").hasClass("animate")){ setTimeout(function(){ var demoFi1 = new CountUp("one", 0, $("#one").attr("end-val"),0,2, options); demoFi1.start(); var demoFi2 = new CountUp("two", 0, $("#two").attr("end-val"),0,2, options); demoFi2.start(); var demoFi3 = new CountUp("three",0, $("#three").attr("end-val"),0,2, options); demoFi3.start(); var demoFi4 = new CountUp("four",0, $("#four").attr("end-val"),0,2, options); demoFi4.start(); },50) } _b = false; }