解决:使用 swiper 自动轮播图片,当拖动过 swiper 内的内容时,致使不继续自动轮播

版本为1.3html

当使用了 swiper 后:api

var mySwiper = new Swiper('.banner .swiper-container', {
    autoplay: 3000,
    loop: true,
    pagination: '.swiper-pagination',
    autoplayDisableOnInteraction : false
})
解决办法便是设置这个参数: autoplayDisableOnInteraction 

官网给出的参数介绍:

用户操做 swiper 以后,是否禁止 autoplay 。默认为 true:中止。
若是设置为 false,用户操做 swiper 以后自动切换不会中止,每次都会从新启动 autoplay。
操做包括 触碰,拖动,点击 pagination 等。
相关文章
相关标签/搜索