$(function () { wowInt(); }) function wowInt(){ if (!(/msie [6|7|8|9]/i.test(navigator.userAgent))){ var wow = new WOW({ boxClass: 'wow', animateClass: 'animated', offset: 0, mobile: true, live: true }); wow.init(); }; } // banner var winw,wint,winh,invideo; var video_start=true; $(function(){ $(window).resize(); $(window).scroll(); winh=$(window).height() // inbanner start var syy=true var mySwiper = new Swiper ('.inbanner .swiper-container', { auto:"false", effect : 'slide', autoplay : 5000, speed:1000, prevButton:'.swiper-button-prev', nextButton:'.swiper-button-next', loop: true, autoplayDisableOnInteraction : false, pagination: '.swiper-pagination', paginationClickable :true, onInit: function(swiper){ $('.inbanner .swiper-wrapper .swiper-slide').eq(swiper.activeIndex).addClass('on'); slide = swiper.slides.eq(0) slide.addClass('ani-slide') }, onSlideChangeEnd:function(swiper){ index_aspx_index = swiper.realIndex slide = swiper.slides.eq(swiper.activeIndex) slide.addClass('ani-slide').siblings().removeClass('ani-slide') }, onSlideChangeStart: function(swiper){ $('.inbanner .swiper-wrapper .swiper-slide').eq(swiper.activeIndex).addClass('on').siblings().removeClass('on') $('.inbanner .swiper-wrapper .swiper-slide').find('video').removeAttr('id') if (winw>200) { if($('.inbanner .swiper-wrapper .swiper-slide').eq(swiper.activeIndex).hasClass('ban_video')){ $('.inbanner .swiper-wrapper .swiper-slide').eq(swiper.activeIndex).find('video').attr('id','ban_video') var video = document.getElementById("ban_video"); video.pause(); video.play(); if(swiper.activeIndex!=1){ mySwiper.stopAutoplay(); } if (!syy) { mySwiper.stopAutoplay(); video.currentTime=0; } video.addEventListener('ended', function (e) { if($('.inbanner .swiper-wrapper .swiper-slide').eq(swiper.activeIndex).hasClass('ban_video')){ //$('.swiper-button-next').click(); mySwiper.slideNext(); mySwiper.startAutoplay(); syy=false; e.stopPropagation(); } }, false); } } else{ $('.inbanner video').fadeOut(); } index_aspx_index = swiper.realIndex for (i = 0; i < swiper.slides.length; i++) { slide = swiper.slides.eq(i) slide.removeClass('ani-slide') } } }) if (winw>200) { mySwiper.on('click',function(swiper){ if(!$('.inbanner .swiper-wrapper .swiper-slide').eq(swiper.activeIndex).hasClass('ban_video')){ mySwiper.startAutoplay(); syy=false; } }) if($('.inbanner .swiper-wrapper .swiper-slide').eq(1).hasClass('ban_video')){ mySwiper.stopAutoplay(); } } // inbanner end }) $(window).resize(function(){ winw=$(window).width() /*棣栭〉inbanner*/ if (winw<767) { $('.index .inbanner li').each(function(){ $(this).css({'background':'url('+$(this).find('img').attr('src2')+')'}) }) } else{ $('.index .inbanner li').each(function(){ $(this).data('ratio','0.2926') $(this).css({'background':'url('+$(this).find('img').attr('src')+')'}) }) } }) // banner $(function(){ if($(window).width()>1024){ var hisnum=3; } if($(window).width()<=1024){ var hisnum=2; } if($(window).width()<=767){ var hisnum=1; } var dlCount=Math.ceil($(".slide_hide").find('dl').size()/hisnum) for(i=0;i
') for(x=0;x20){ spacenum = parseInt(max/20); } // console.log(spacenum+"spacenum锛?+arr) if($(window).scrollTop() > wraper.offset().top-$(window).height()/1.2){ flag = false; // console.log(flag+"锛?1锛?) var timer = setInterval(function() { arr = arr + spacenum; arr < max ? arr : clearInterval(timer); // console.log(flag+"锛?1锛?+arr) if(arr>=max){ target.find("i").html(toThousands(max)); target.find("b").html(max); }else{ target.find("i").html(arr); target.find("b").html(arr); } }, 50); } $(window).scroll(function(){ if(flag){ if($(window).scrollTop() > wraper.offset().top-$(window).height()/1.2){ flag = false; //console.log(flag+"22") var timer = setInterval(function() { arr = arr + spacenum; arr < max ? arr : clearInterval(timer); if(arr>=max){ target.find("i").html(toThousands(max)); target.find("b").html(max); }else{ target.find("i").html(arr); target.find("b").html(arr); } }, 50); } } }) } // 鏍煎紡鍖栨暟瀛 function toThousands(num) { return (num || 0).toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1'); }