我的带有 Swiper.js 的滑动器在用手指滑动后停止自动播放,为什么?

新手上路,请多包涵
var mySwiper = new Swiper('.myswiper', {
        autoplay: 3000,
        simulateTouch: true,
        loop: true,
        preloadImages: true,
        speed: 200,
        pagination: '.swiper-pagination'
    });

虽然这是我的初始滑动器,当我用鼠标拖动它或用手指触摸它然后滑动它时,我的滑动器停止自动播放,如何解决?

原文由 Alex Lee 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 470
1 个回答

现在是“disableOnInteraction”

 var mySwiper = new Swiper ('.swiper-container', {
    direction: 'horizontal',
    loop: true,
    scrollbar: { el: '.swiper-scrollbar' },
    autoplay: {
        delay: 5000,
        disableOnInteraction: false
    }
});

原文由 williamsi 发布,翻译遵循 CC BY-SA 4.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题