$(function(){ $('.series .list .item').hover(function(){ $this = $(this); var data = $this.data('index') $this.stop().addClass('active').siblings().removeClass('active') $('.series .bg img[data-num="'+ data +'"]').stop(true,false).fadeIn().siblings().stop(true,false).fadeOut(); }) var mySwiper3 = new Swiper ('.swiper3', { direction: 'horizontal', // 垂直切换选项 loop: true, // 循环模式选项 speed:1000, // 如果需要分页器 pagination: { el: '.swiper-pagination3', type:'progressbar', }, // 如果需要前进后退按钮 navigation: { nextEl: '.swiper-button-next3', prevEl: '.swiper-button-prev3', }, on:{ init: function(){ swiperAnimateCache(this); //隐藏动画元素 swiperAnimate(this); //初始化完成开始动画 }, slideChangeTransitionEnd: function(){ swiperAnimate(this); //每个slide切换结束时也运行当前slide动画 //this.slides.eq(this.activeIndex).find('.ani').removeClass('ani'); 动画只展现一次,去除ani类名 } } }) //case轮播图 var case_Swiper = undefined; if ($(document).width() > 1024) { case_Swiper = new Swiper(".case_Swiper", { slidesPerView: 2, spaceBetween: 50, loop: true, // 循环模式选项 // autoplay: { // delay: 3000, // stopOnLastSlide: false, // disableOnInteraction: false, // }, on: { init: function () { swiperAnimateCache(this); //隐藏动画元素 swiperAnimate(this); //初始化完成开始动画 }, slideChangeTransitionEnd: function () { swiperAnimate(this); //每个slide切换结束时也运行当前slide动画 //this.slides.eq(this.activeIndex).find('.ani').removeClass('ani'); 动画只展现一次,去除ani类名 }, }, pagination: { el: ".cswiper-pagination", type: 'progressbar',//进度条样式 }, }); } else { case_Swiper = new Swiper(".case_Swiper", { slidesPerView: 1, spaceBetween: 50, loop: true, // 循环模式选项 // autoplay: { // delay: 3000, // stopOnLastSlide: false, // disableOnInteraction: false, // }, on: { init: function () { swiperAnimateCache(this); //隐藏动画元素 swiperAnimate(this); //初始化完成开始动画 }, slideChangeTransitionEnd: function () { swiperAnimate(this); //每个slide切换结束时也运行当前slide动画 //this.slides.eq(this.activeIndex).find('.ani').removeClass('ani'); 动画只展现一次,去除ani类名 }, }, pagination: { el: ".cswiper-pagination", type: 'progressbar',//进度条样式 }, }); } })