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,
}}