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 / ' + productLis_len) 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 / 1000, { 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) + ' / ' + productLis_len); }, slideChangeTransitionStart: function () { for (var i = 0; i < productLis_len; 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; }); } }