swiper实现滑动到某页锁住不让滑动

var swiper = new Swiper('.swiper-container', {
    pagination: '.swiper-pagination',
    onTouchStart: function(swiper,even){
        swiper.unlockSwipeToPrev();
        swiper.unlockSwipeToNext();
        if(swiper.isEnd){
            swiper.lockSwipeToNext();
        }else if(swiper.activeIndex==0){
            swiper.lockSwipeToPrev();
        }
    }
});

 

swiper文档(swiper3):lockSwipeToNext 

posted @ 2019-10-22 15:34  rachelch  阅读(3415)  评论(0编辑  收藏  举报