what are the properties of autoplay in the swiper slider?

The properties of autoplay in the Swiper slider are:

  1. delay: Specifies the time interval between each slide transition during autoplay. The default value is 3000 milliseconds (3 seconds).
  2. disableOnInteraction: Determines whether the autoplay should be paused when the user interacts with the slider. The default value is true, meaning that the autoplay will stop when the user interacts with the slider.
  3. stopOnLastSlide: Determines whether the autoplay should be stopped when the slider reaches the last slide. The default value is false, meaning that the slider will continue to loop through the slides even after reaching the last slide.
  4. reverseDirection: Determines whether the autoplay should play the slides in reverse order after reaching the last slide. The default value is false, meaning that the autoplay will restart from the first slide after reaching the last slide.

Here’s an example of how to set these properties in Swiper:

var mySwiper = new Swiper(‘.swiper-container’, {
autoplay: {
delay: 5000,
disableOnInteraction: false,
stopOnLastSlide: true,
reverseDirection: true,
},
});

In this example, the slider will autoplay every 5 seconds, continue to play even if the user interacts with the slider, stop when it reaches the last slide, and play the slides in reverse order after reaching the last slide.

Leave a comment

Your email address will not be published. Required fields are marked *