admin管理员组文章数量:1316817
var mySwiper = new Swiper('.myswiper', {
autoplay: 3000,
simulateTouch: true,
loop: true,
preloadImages: true,
speed: 200,
pagination: '.swiper-pagination'
});
While this is my initial swiper, and when I drag it with mouse or touch it with finger and then slided it, my swiper stops auto playback, how to fix it?
var mySwiper = new Swiper('.myswiper', {
autoplay: 3000,
simulateTouch: true,
loop: true,
preloadImages: true,
speed: 200,
pagination: '.swiper-pagination'
});
While this is my initial swiper, and when I drag it with mouse or touch it with finger and then slided it, my swiper stops auto playback, how to fix it?
Share Improve this question asked Aug 26, 2016 at 5:58 Alex LeeAlex Lee 1411 gold badge1 silver badge5 bronze badges 1- 1 can you share your html or Fiddle. – Sarath Kumar Commented Aug 26, 2016 at 6:00
3 Answers
Reset to default 28It's now 'disableOnInteraction'
var mySwiper = new Swiper ('.swiper-container', {
direction: 'horizontal',
loop: true,
scrollbar: { el: '.swiper-scrollbar' },
autoplay: {
delay: 5000,
disableOnInteraction: false
}
});
The best solution is to find the answer in API of Swiper, like Autoplay Demo.
You should insert the swipe attribute below:
autoplayDisableOnInteraction: false
The instruction of this attribute:
Set to false and autoplay will not be disabled after user interactions (swipes), it will be restarted every time after interaction.
Use autoplay as define here
autoplay={{
delay: 2500,
disableOnInteraction: false,
}}
本文标签: javascriptMy swiper with Swiperjs stop autoplay after slide it with fingerwhyStack Overflow
版权声明:本文标题:javascript - My swiper with Swiper.js stop autoplay after slide it with finger, why? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738133572a2065346.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论