$(function () { var interleaveOffset = 0.3; browserRedirect(); //检查平台 const swiperFullPage = new Swiper('.swiperFullPage', { direction: 'vertical', // Slides的滑动方向-垂直 mousewheel: true, // 开启鼠标滚轮控制Swiper切换。 speed: 500, slidesPerView: 'auto', // 设置slider容器能够同时显示的slides数量(carousel模式)。'auto'则自动根据slides的宽度来设定数量。 watchSlidesProgress: true, mousewheel: true, hashNavigation: true, //为每个slide增加散列导航(有点像锚链接) // 分页器 pagination: { el: '.swiperFullPage>.swiper-pagination', clickable: true, }, on: { // init: function() { // swiperAnimateCache(this); // swiperAnimate(this); // }, // transitionEnd: function() { // swiperAnimate(this); // }, touchStart: function () { var swiper = this; for (var i = 0; i < swiper.slides.length; i++) { swiper.slides[i].style.transition = ""; } }, slideChange: function () { this.activeIndex != 0 ? $(".header").addClass("open") : $(".header").removeClass("open"); this.activeIndex != 0 ? $(".topInfo").addClass("close") : $(".topInfo").removeClass("close"); // if (this.activeIndex == 2) { // setTimeout(function() { // guonei.start(); // chenggui.start(); // qian.start(); // }, 1500) // } console.log(this.activeIndex) if (this.activeIndex >= 6) { $(".tips").addClass("active"); } else { $(".tips").removeClass("active"); } }, }, }); // 轮播图 // const banner = new Swiper('.homeBanner', { // direction: 'horizontal', // 垂直切换选项 // loop: true, // 循环模式选项 // autoplay: { // delay: 3000 // }, // paginationClickable: true, // observer: true, // // autoplayDisableOnInteraction:false, // onTransitionEnd: function (banner) { // if ($('.swiper-slide-active').children().hasClass('banner-video')) { // $('.swiper-slide-active video')[0].paly(); // banner.stopAutoplay(); // banner.params.autoplay - 10; // } // }, // pagination: { // el: '.homeBanner>.swiper-pagination', // clickable: true, // }, // }); // $('.swiper-slide-active video').on('play', function () { // banner.stopAutoplay(); // }); // if ($('.swiper-slide-active').children().hasClass('banner-video')) { // $('.swiper-slide-active video')[0].paly(); // } // $('.swiper-slide-active video').on('play', function () { // banner.stopAutoplay(); // }); const banner = new Swiper('.homeBanner', { direction: 'horizontal', // 垂直切换选项 loop: true, // 循环模式选项 speed:2500, autoplay: { delay: 5000 }, pagination: { el: '.homeBanner>.swiper-pagination', clickable: true, }, }); //历程 const progress = new Swiper('.progress', { direction: 'horizontal', // 垂直切换选项 loop: true, // 循环模式选项 centeredSlides: true, autoplay: false, slidesPerView: 3, spaceBetween: 30, breakpoints: { 768: { slidesPerView: 1, spaceBetween: 0, }, 900: { slidesPerView: 2, spaceBetween: 15, }, }, navigation: { nextEl: '.progress-prev-next-btn .swiper-button-next', prevEl: '.progress-prev-next-btn .swiper-button-prev', }, }); // 解决方案 背景图切换 const solutionItembackgroundImg = new Swiper('.solutionItembackgroundImg', { paginationClickable: true, effect: 'fade', slidesPerView: 1, pagination: { el: '.solutionItembackgroundImg>.swiper-pagination', clickable: true, }, on: { // slideChangeTransitionStart: function () { // $(".solutionItem .active").removeClass('active'); // $(".solutionItem .item").eq(this.activeIndex).addClass('active'); // }, // init: function(swiper){ // $(".solutionItem .item").eq(this.activeIndex).addClass('active'); // }, } }); $(".solutionItem .item").on('mouseover', function (e) { e.preventDefault(); solutionItembackgroundImg.slideTo($(this).index()); }); //公司荣誉 const honorSty1 = new Swiper('.honorSty1', { slidesPerView: 5, autoplay: { delay: 3000 }, breakpoints: { 990: { slidesPerView: 3, }, 768: { slidesPerView: 2, }, 390: { slidesPerView: 2, spaceBetween: 20, slidesPerColumn: 2, }, } }); const honorSty2 = new Swiper('#honorSty2', { slidesPerView: 3, spaceBetween: 30, autoplay: { delay: 3000 }, breakpoints: { 990: { slidesPerView: 3, }, 768: { slidesPerView: 2, slidesPerColumn: 2, }, 560: { slidesPerView: 1, slidesPerColumn: 2, }, } }); //公司新闻 const news = new Swiper('.newsListBox', { slidesPerView: 3, spaceBetween: 40, scrollbar: { el: '.swiper-scrollbar', }, breakpoints: { 1200: { slidesPerView: 2, }, 768: { slidesPerView: 1, }, } }); // 广告 const ad = new Swiper('.adListBox', { slidesPerView: 3, spaceBetween: 40, scrollbar: { el: '.swiper-scrollbar', }, breakpoints: { 1200: { slidesPerView: 2, }, 768: { slidesPerView: 1, }, } }); // 合作客户 const partner = new Swiper('.partnerBox', { slidesPerView: 6, spaceBetween: 40, slidesPerColumn: 3, // slidesPerColumnFill : 'row', breakpoints: { 768: { slidesPerView: 3, slidesPerColumn: 6, }, 390: { slidesPerView: 2, spaceBetween: 20, slidesPerColumn: 6, }, }, navigation: { nextEl: '.partner-prev-next-btn .swiper-button-next', prevEl: '.partner-prev-next-btn .swiper-button-prev', }, }); //微信,钉钉 $(".contactInfo .right .icon-weixin").hover(function () { $(".contactInfo .right .weixin").toggle(); }); $(".contactInfo .right .icon-pinpaibiaoshi-dingding").hover(function () { $(".contactInfo .right .dingding").toggle(); }); // 给合作客户的LOGO加动效 $(".partnerList .item:nth-child(odd)").addClass("delay-1"); $(".partnerList .item:nth-child(even)").addClass("delay-2"); }); //检测平台 function browserRedirect() { var sUserAgent = navigator.userAgent.toLowerCase(); if (/ipad|iphone|midp|rv:1.2.3.4|ucweb|android|windows ce|windows mobile/.test(sUserAgent)) { $(".banner-video").remove(); } else { } };