前端 解决swiper js 手动滑动一下后不能自动播放


 

用户操作swiper之后,是否禁止autoplay。默认为true:停止。
如果设置为false,用户操作swiper之后自动切换不会停止,每次都会重新启动autoplay。
操作包括触碰,拖动,点击pagination等。

参数是: autoplayDisableOnInteraction

示例:

 <script>

   var mySwiper = new Swiper('.swiper-container',

    {

      autoplay : 5000,

      autoplayDisableOnInteraction : false,

    })

</script>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM