var productseries = { percent: 0, timers: "", index: function () { var _w = $('body').width(), _w_2 = _w / 2, _h_series = $('.citrus .r .bottom').height() //系列 var $productlis = $('.citrus .productlis .li'), productlis_len = $('#visualtcon').data('len'), $pagenumber = $('.pagenumber') $pagenumber.html('1 / ' + 6) var time = 4000; var transition_time = 1200; var time_with_trans = (time + transition_time) / 1000; //系列右下图 $('.productlis .pic').attr('data-swiper-parallax-x', _w_2) $('.citrus .r .bottom .pic').attr('data-swiper-parallax-y', _h_series) var productshow = new swiper('.productshow', { loop: true, parallax: true, noswiping: true, direction: 'vertical', speed: transition_time, }); //右上文字 var producttxtshow = new swiper('.producttext', { loop: true, parallax: true, noswiping: true, direction: 'vertical', speed: transition_time, }); //切换效果及时间控制 var timer = new tweenmax.to('.timercurrent', time / 6000, { css: { transform: 'scalex(1)' }, ease: linear.easenone, oncomplete: function () { productshow.slidenext(); producttxtshow.slidenext(); productlis.slidenext(); } }); timer.pause(); //系列左侧大图 var productlis = new swiper('.productlis', { loop: true, noswiping: true, parallax: true, speed: transition_time, on: { init: function () { timer.restart(); }, transitionstart: function () { timer.duration(time_with_trans) timer.restart(); $pagenumber.html((this.realindex + 1) + ' / ' + 6) }, slidechangetransitionstart: function () { for (var i = 0; i < 6; i++) { $productlis.find(i).find('.pic').css({ 'transform': 'translatex(0)' }) } } }, observer:true, observeparents:true }); $('.citrus .btnr').click(function (e) { productshow.slidenext(); producttxtshow.slidenext(); productlis.slidenext(); }) $('.citrus .btnl').click(function (e) { productshow.slideprev(); producttxtshow.slideprev(); productlis.slideprev(); }) productlis.on('slidechange', function () { var current_slide = this.previousindex; var new_slide = this.realindex; }); }, }