13
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?

Alex Lee
  • 141
  • 1
  • 1
  • 5

3 Answers3

27

It's now 'disableOnInteraction'

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

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.

Colin Lee
  • 201
  • 2
  • 4
0

Use autoplay as define here

  autoplay={{
               delay: 2500,
               disableOnInteraction: false,
            }}