$(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',//进度条样式 }, }); } })