function scrollAni() { $('.js-mobole').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() { $('.js-mobole').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'); } }); }); } scrollAni(); time(); $(window).scroll(function(){ time(); }) function time(){ var _b=true; var options = { useEasing: true, useGrouping: true, separator: '', decimal: '.' }; if($(".num-ul-list .li").eq(0).find(".num").text()!= 0){ return; } if($(".wel-advantages").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(); },50) } _b = false; } // var video = document.getElementById("pcvideo"); // var interleaveOffset = 0.5; 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(); }) function numbox(num){ num=num.replace(/\b(0+)/gi,""); if(num == 0){ num = 0; }else if(num > 9){ num = num; }else{ num="0"+num; } return num; } 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, noSwiping : true, onInit: function(swiper){ $(".wel-banner .secwen").removeClass('animate'); setTimeout(function(){ $(".wel-banner .swiper-slide-active .secwen").addClass('animate'); },100) var i = swiper.activeIndex; var videoIndex = $('.wel-banner .swiper-slide-active.videoboxs').data('swiper-slide-index'); var activeIndex = $('.wel-banner .swiper-slide-active').data('swiper-slide-index'); var banLen = $('.wel-banner .swiper-slide').length; if(banLen==1){ // $('.index_pagination').hide(); swiper.stopAutoplay(); } if(videoIndex == activeIndex){ swiper.stopAutoplay(); // $('.index_pagination').hide(); $(".swiper-slide-active.videoboxs").eq(activeIndex).find("video")[0].load(); $(".swiper-slide-active.videoboxs").eq(activeIndex).find("video")[0].play(); // $(".videoboxs").eq(activeIndex).find("video")[0].addClass("io") } 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) }) } }, onSlideChangeStart:function(swiper){ var videoIndex = $('.wel-banner .swiper-slide-active.videoboxs').data('swiper-slide-index'); var activeIndex = $('.wel-banner .swiper-slide-active').data('swiper-slide-index'); if(videoIndex == activeIndex){ $('.wel-banner .swiper-slide-active video')[0].load(); }else{ $('.index_pagination').show(); } }, onTransitionStart: function(swiper){ $(".wel-banner .secwen").removeClass('animate'); setTimeout(function(){ $(".wel-banner .swiper-slide-active .secwen").addClass('animate'); },100) var i = swiper.activeIndex; var videoIndex = $('.wel-banner .swiper-slide-active.videoboxs').data('swiper-slide-index'); var activeIndex = $('.wel-banner .swiper-slide-active').data('swiper-slide-index'); if(videoIndex == activeIndex){ $('.wel-banner .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) }) } }, onTransitionEnd: function(swiper){ var i = swiper.activeIndex; var videoIndex = $('.wel-banner .swiper-slide-active.videoboxs').data('swiper-slide-index'); var activeIndex = $('.wel-banner .swiper-slide-active').data('swiper-slide-index'); if(videoIndex == activeIndex){ $('.wel-banner .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) }) } } }) }else{ $(".wel-banner .secwen").addClass('animate'); $(".wel-banner .ibtn").hide(); if($(".wel-banner .swiper-slide").hasClass("videoboxs")){ $(".wel-banner .swiper-slide.videoboxs video")[0].load(); $(".wel-banner .swiper-slide.videoboxs video")[0].play(); $(".wel-banner .swiper-slide.videoboxs video").attr("loop","loop") } } clickVideo($(".videoboxs .mimgs"))