$(function ($) { // homeTop $(".homeTop").hover(function () { $(this).removeClass("hover"); },function () { $(this).addClass("hover"); }) // Home var s_num = $('#fullpage .section').length; var myFullpage = new fullpage('#fullpage', { responsiveWidth: 1200, scrollingSpeed: 1000, fitToSection: false, v2compatible: true, afterLoad: function (anchorLink, index) { if (index == 1) { // $(".homeBanner video")[0].play(); } if (index == 2) { $(".homeApp").addClass("ani") } if (index == 3) { $(".homeAbout").addClass("ani"); setTimeout(function () { $('.homeAbout .counter').each(function () { numscroll($(this)); }); },1000) } if (index == 4) { $(".homeFactory").addClass("ani"); $(".homeFactory li").eq(0).click() setTimeout(function () { $('.homeFactory .counter').each(function () { numscroll($(this)); }); },1000) } if (index == 5) { $(".homeNews").addClass("ani");; } if (index == 6) { $(".homeBottom").addClass("ani");; } if (index == s_num) { $("#fp-nav").fadeOut() }else { $("#fp-nav").fadeIn() } }, onLeave: function (index, nextIndex, direction ) { if (index == 3) { $(".homeAbout .numBox").removeClass("active"); } } }); myFullpage.setAllowScrolling(false) if(first_view==1){ //首次访问 $("#loading").show() $(".index_show").show() // loading $("").insertAfter(".svg1") // var t = setTimeout(function () { $("#loading").hide(); $(".homeTop").addClass("ani"); $("body").removeClass("ovh").removeClass("loading_show") myFullpage.setAllowScrolling(true) // },8000) var t2 = setTimeout(function () { $(".layer").fadeOut() },5000) var t3 = setTimeout(function () { // banner video.slick_one(".homeBanner", 1, false, true); },3000) }else{ $(".index_show").show() video.slick_one(".homeBanner", 1, false, true); $(".layer").fadeOut() $("#loading").hide(); $(".homeTop").addClass("ani"); $("body").removeClass("ovh").removeClass("loading_show") myFullpage.setAllowScrolling(true) } // document.getElementById('video').play(); // document.addEventListener("WeixinJSBridgeReady", function () { // document.getElementById('video').play(); // }, false); function numscroll(_this) { var Current = _this.parents('.numBox').offset().top; var bolExec = _this.attr("bolexec"); var vnums = _this.data('nums'); if(bolExec == 'true'){ bolExec = true; }else{ bolExec = false; } if ($(window).scrollTop() > Current - $(window).height() - 300 && bolExec) { function Animate() { var counter = 0, val = _this.text() - 0, _time = 200, vLen = (val + "").length; var timer = setInterval(function () { counter++; var step = parseInt(val / _time * counter); // key var text = ""; for (var j = 0; j < vLen - (step + "").length; j++) { // 閸撳秶绱� 0 text += 0; } _this.text(text + step); // if (counter >= _time) { clearInterval(timer); _this.html(vnums); } }, 10); } Animate(); _this.attr("bolexec", "false"); } } $(".homeApp .infoList ul").slick({ arrows: false, autoplay: false, autoplaySpeed: 8000, fade: true, infinite: false, pauseOnHover: false, asNavFor: $(".homeApp .picList ul") }) $(".homeApp .picList ul").slick({ arrows: false, autoplay: true, autoplaySpeed: 8000, infinite: false, pauseOnHover: false, slidesToShow: 10, asNavFor: $(".homeApp .infoList ul"), responsive: [ { breakpoint:650, settings:{ slidesToShow: 3, } }, { breakpoint:800, settings:{ slidesToShow: 5, } }, { breakpoint:1200, settings:{ slidesToShow: 8, } } ] }) $(".homeApp .picList ul li").click(function () { $(".homeApp .infoList ul").slick('slickGoTo', $(this).index()) }) video.slick_one(".homeFactory .content",1,true,false) // document.addEventListener("WeixinJSBridgeReady", function () { // $(".homeFactory .infoList .content li.has-video video").each(function () { // var videoId = $(this).attr("id"); // var fvideo=document.getElementById(videoId) // fvideo.play() // }) // }, false); $(".homeFactory .subMenu li").click(function () { var index = $(this).index(); $(this).addClass("on").siblings().removeClass("on"); $(".homeFactory .infoList .content").eq(index).removeClass("hide").siblings().addClass("hide"); // $(".homeFactory .infoList .content").eq(index).siblings().find("video")[0].pause(); // $(".homeFactory .infoList .content").eq(index).find("video")[0].play(); // $(".homeFactory .infoList .content").eq(index).find(".slider").slick('slickGoTo', 0) // $(".homeFactory .infoList .content").eq(index).siblings().find(".slider").slick("slickPause") }); $(".homeFactory li").eq(0).click() new WOW().init(); })