赞
踩
this.$nextTick(()=>{
window.swiper = new Swiper('.swiper-container', {
slidesPerView : 3,
centeredSlides : true,
slideToClickedSlide: true,
width: this.getPxFromRem(17.55),
spaceBetween : this.getPxFromRem(.25),
slidesOffsetAfter: this.getPxFromRem(12),
loop: false,
initialSlide: Number(_this.nowProgress),
followFinger:false,
on:{
slideChange: function(){
_this.nowProgress = swiper.activeIndex;
var rankNumber = _this.fundConentsList.length;
var diff = rankNumber - swiper.activeIndex;
var perMove = $(".swiper-slide").width();
var distance = (-perMove) * (swiper.activeIndex+diff-3);
if(diff<3){
$(".swiper-wrapper").css({"transform":'translate3d(' + distance + 'px, 0px,0px)'});
}
if(swiper.activeIndex == 0){
$(".swiper-wrapper").css({"transform":'translate3d(0px, 0px,0px)'});
}
},
},
})
var rankNumber = _this.fundConentsList.length;
var diff = rankNumber - _this.nowProgress;
var perMove = $(".swiper-slide").width();
var distance = (-perMove) * (_this.nowProgress+diff-3);
if(diff<3){
$(".swiper-wrapper").css({"transform":'translate3d(' + distance + 'px, 0px,0px)'});
}
if(_this.nowProgress == 0){
$(".swiper-wrapper").css({"transform":'translate3d(0px, 0px,0px)'});
}
})
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。