当前位置:   article > 正文

swiper 导航栏_swiper导航栏

swiper导航栏

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)'});

}

})

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/菜鸟追梦旅行/article/detail/133954
推荐阅读
  

闽ICP备14008679号