$(function() { var width = $(window).width(); var height = $(window).height(); if(isFrontEnv()){ if (width > 1024) { $('.ctn1').height(height); var animationController = new ScrollMagic.Controller({ addIndicators: false }); var t1 = new TimelineMax(); t1.to(".ctn1 .top", 1, { background: "transparent", }); t1.to(".ctn1 .top .con", 1, { top: "4vw", }, "-=0.5"); t1.to(".ctn1 .bottom", 1, { opacity: "1", bottom: "-100px", }, "-=1"); t1.to(".ctn1 .line-box", 1, { opacity: "1" }); t1.to(".ctn1 .p1", 1, { opacity: "0" }); t1.to(".ctn1 .p2", 1, { opacity: "1" }, "-=0.5"); t1.to(".ctn1 .p2", 1, { opacity: "0" }); t1.to(".ctn1 .p3", 1, { opacity: "1" }, "-=0.5"); t1.to(".ctn1 .p3", 1, { opacity: "0" }); t1.to(".ctn1 .p4", 1, { opacity: "1" }, "-=0.5"); new ScrollMagic.Scene({ triggerElement: '.ctn1', duration: "100%", triggerHook: 'onLeave', }) .setPin('.ctn1') .setTween(t1) .addTo(animationController); } else { var mobile_swiper = new Swiper('.mobile-swiper .swiper-container', { autoplay: { delay: 5000, stopOnLastSlide: false, disableOnInteraction: false, }, pagination: { el: '.mobile-swiper .swiper-pagination', clickable: true, }, }); } } if (width > 1024) { $('.header').removeClass('active'); window.addEvent('scroll', function() { if (window.scrollY <= 10) { $('.header').removeClass('active'); } else { $('.header').addClass('active'); } }); } var banner = new Swiper('.banner .swiper-container', { speed: 1000, loop: true, // autoplay:false, /*autoplay: { delay: 5000, stopOnLastSlide: false, disableOnInteraction: false, },*/ pagination: { el: '.banner .swiper-pagination', clickable: true, }, }) var swiper2 = new Swiper('.ctn2 .swiper-container', { autoplay:false, spaceBetween: 20, slidesPerView: 3.5, speed: 1000, pagination: { el: ".ctn2 .swiper-pagination", type: "progressbar", }, breakpoints: { 1200: { //当屏幕宽度大于等于768 slidesPerView : 2.5, spaceBetween:10, }, 768: { //当屏幕宽度大于等于768 slidesPerView: 1.2, spaceBetween: 10, } }, // navigation: { // nextEl: ".report .swiper-button-next", // prevEl: ".report .swiper-button-prev", // }, // pagination: { // el: '.report .swiper-pagination', // clickable: true, // }, }); })