//杩斿洖椤堕儴 function movetop(){ var width=$(document.body).width(); if(width>1200){ var h = parseInt($(window).height()); }else{ var h = parseInt($(".about-boxs").height()); } setTimeout(function(){ $('html,body').animate({ scrollTop: h }, 1000); },2000); } if($(window).scrollTop() > 50) { $('html,body').animate({ scrollTop: 0 }, 0); }else { movetop(); } $('.tips-box a').on(tap, function(){ // $('html,body').animate({ scrollTop: 0 }, 200); }) $('.next-page').on(tap, function(){ var width=$(document.body).width(); if(width>1200){ var h = parseInt($(window).height()); }else{ var h = parseInt($(".about-boxs").height()); } $('html,body').animate({ scrollTop: h }, 200); }) function section(){ var width=$(document.body).width(); var vh = parseInt($(window).height()); var vh1 = parseInt($(window).height())*0.9; if(width>1200){ $(".wrapper").css("margin-top", vh + 'px'); $(".about-boxs").css("height", vh + 'px'); $(".section-box.section1").css("height", vh1 + 'px'); $(".section-box.section2").css("height", vh1 + 'px'); $(".section-box.section3").css("height", vh1 + 'px'); } } section(); //绉诲姩绔Щ闄よ棰 $(window).resize(function(){ var width=$(document.body).width();//寰楀埌鍙灞忓箷鐨勫搴 var vh=$(document.body).height();//寰楀埌鍙灞忓箷鐨勫搴 if(width>1200){ section(); } }) //杞挱1 var mySwiper1 = new Swiper('.section-box.section1 .section-main .swiper-container', { loop : false, autoplay : false, autoplayDisableOnInteraction : false, speed: 1000, effect : 'fade', autoHeight: true, fade: { crossFade: true, }, pagination : '.section-box.section1 .swiper-pagination', paginationClickable :true, onInit: function(swiper){ var len = $(".section-box.section1 .swiper-pagination-bullet").length; if(len > 1){ $(".section-box.section1 .swiper-pagination").show(); }else{ $(".section-box.section1 .swiper-pagination").hide(); } }, onSlideChangeStart: function(swiper) { // $(".swiper-slide-active").find(".section-cont").addClass("fadeInDown animated"); // $(".swiper-slide:not('.swiper-slide-active')").find(".section-cont").removeClass("fadeInDown animated"); // $(".section-box.section1 .bottom-img img").eq(swiper.activeIndex).addClass("on").siblings().removeClass("on"); // $(".section-box.section1 .big-bg .bgs").eq(swiper.activeIndex).addClass("on").siblings().removeClass("on"); // $(".section-box.section1 .ph-bg .bgs").eq(swiper.activeIndex).addClass("on").siblings().removeClass("on"); } }) //杞挱2 var mySwiper2 = new Swiper('.section-box.section2 .section-main .swiper-container', { loop : false, autoplay : false, autoplayDisableOnInteraction : false, speed: 1000, effect : 'fade', autoHeight: true, fade: { crossFade: true, }, pagination : '.section-box.section2 .swiper-pagination', paginationClickable :true, onInit: function(swiper){ var len = $(".section-box.section2 .swiper-pagination-bullet").length; if(len > 1){ $(".section-box.section2 .swiper-pagination").show(); }else{ $(".section-box.section2 .swiper-pagination").hide(); } }, onSlideChangeStart: function(swiper) { // $(".swiper-slide-active").find(".section-cont").addClass("fadeInDown animated"); // $(".swiper-slide:not('.swiper-slide-active')").find(".section-cont").removeClass("fadeInDown animated"); // $(".section-box.section2 .bottom-img img").eq(swiper.activeIndex).addClass("on").siblings().removeClass("on"); // $(".section-box.section2 .big-bg .bgs").eq(swiper.activeIndex).addClass("on").siblings().removeClass("on"); // $(".section-box.section2 .ph-bg .bgs").eq(swiper.activeIndex).addClass("on").siblings().removeClass("on"); } }) //杞挱3 var mySwiper3 = new Swiper('.section-box.section3 .section-main .swiper-container', { loop : false, autoplay : 10000, autoplayDisableOnInteraction : false, speed: 1000, effect : 'fade', autoHeight: true, fade: { crossFade: true, }, pagination : '.section-box.section3 .swiper-pagination', paginationClickable :true, onInit: function(swiper){ var len = $(".section-box.section3 .swiper-pagination-bullet").length; if(len > 1){ $(".section-box.section3 .swiper-pagination").show(); }else{ $(".section-box.section3 .swiper-pagination").hide(); } }, onSlideChangeStart: function(swiper) { $(".section-box.section3 .swiper-slide-active").find(".section-cont").addClass("fadeInDown animated"); $(".section-box.section3 .swiper-slide:not('.swiper-slide-active')").find(".section-cont").removeClass("fadeInDown animated"); $(".section-box.section3 .bottom-img img").eq(swiper.activeIndex).addClass("on").siblings().removeClass("on"); $(".section-box.section3 .big-bg .bgs").eq(swiper.activeIndex).addClass("on").siblings().removeClass("on"); $(".section-box.section3 .ph-bg .bgs").eq(swiper.activeIndex).addClass("on").siblings().removeClass("on"); } }) var mySwiper4 = new Swiper('.section-box.section1 .big-bg .swiper-container', { loop : false, autoplay : 5000, autoplayDisableOnInteraction : false, speed: 1000, effect : 'fade', fade: { crossFade: true, } }) var mySwiper5 = new Swiper('.section-box.section1 .ph-bg .swiper-container', { loop : false, autoplay : 5000, autoplayDisableOnInteraction : false, speed: 1000, effect : 'fade', fade: { crossFade: true, } }) var mySwiper6 = new Swiper('.section-box.section2 .big-bg .swiper-container', { loop : false, autoplay : 5000, autoplayDisableOnInteraction : false, speed: 1000, effect : 'fade', fade: { crossFade: true, } }) var mySwiper7 = new Swiper('.section-box.section2 .ph-bg .swiper-container', { loop : false, autoplay : 5000, autoplayDisableOnInteraction : false, speed: 1000, effect : 'fade', fade: { crossFade: true, } }) //閿氱偣璺宠浆 $('.left-nav .nav a').on(tap, function(){ var id = $(this).attr('href'); anchor(id); }) //杩斿洖椤堕儴 var h = parseInt($(window).height()); var h1 = parseInt($(".header-box .tips-box").innerHeight()); var h2 = parseInt($(window).height()+$(".header-box .tips-box").innerHeight()); $(window).scroll(function () { var width=$(document.body).width();//寰楀埌鍙灞忓箷鐨勫搴 var hh = parseInt($(".main-box").innerHeight()); var hh1 = h2+0.2*hh; var hh2 = h2+0.42*hh; var hh3 = h2+0.75*hh; if ($(window).scrollTop() > h2) { $(".header-box").addClass("on"); $('.back-top').fadeIn(); }else { $(".header-box").removeClass("on"); $('.back-top').fadeOut(); } if ($(window).scrollTop() > hh1){ $(".logo-bg").addClass("on2"); }else{ $(".logo-bg").removeClass("on2"); } if ($(window).scrollTop() > hh2){ $(".logo-bg").addClass("on3"); }else{ $(".logo-bg").removeClass("on3"); } if ($(window).scrollTop() > hh3){ $(".logo-bg").addClass("on4"); }else{ $(".logo-bg").removeClass("on4"); } if ($(window).scrollTop() > h2*0.6) { $('.left-nav').fadeIn(); }else { $('.left-nav').fadeOut(); } }); //閿氱偣璺宠浆 $('.left-nav .nav span').on(tap, function(){ var id = $(this).attr('href'); anchor(id); }) //杩斿洖椤堕儴 $('.back-top').click(function () { var width=$(document.body).width(); if(width>767){ ht=h; }else{ ht=0.5*h; } $('html,body').animate({ scrollTop: ht }, 200); }); //鏂伴椈杞挱鍥 var mySwiper8 = new Swiper('.swiper-container.news', { loop : false, autoplay : false, autoplayDisableOnInteraction : false, speed: 500, nextButton: '.news-box .swiper-next', prevButton: '.news-box .swiper-prev', pagination : '.news-box .swiper-pagination', paginationClickable :true, slidesPerView : 4, spaceBetween : 40, onInit: function(swiper){ var len = $(".news-box .swiper-slide").length; if(len > 3){ $(".news-box .news-list .ctrl-box").show(); }else{ $(".news-box .news-list .ctrl-box").hide(); } }, onSlideChangeStart: function(swiper) { if(mySwiper8.isEnd){ $(".news-box .news-list .swiper-prev").show(); $(".news-box .news-list .swiper-next").hide(); }else{ $(".news-box .news-list .swiper-prev").show(); $(".news-box .news-list .swiper-next").show(); } if(mySwiper8.isBeginning){ $(".news-box .news-list .swiper-prev").hide(); $(".news-box .news-list .swiper-next").show(); } }, breakpoints: { 991: { slidesPerView : 1, spaceBetween : 0, } } }) //鏂伴椈鏈€鍚庝竴涓搴 function newswidth(){ var width=$(document.body).width(); if(width<991){ $(".news-box .swiper-slide:last-child").remove(); mySwiper8.update(); } } newswidth(); $(window).resize(function(){ newswidth(); })