I am creating auto swiper, i would like to display it as Slide1,2,3,4,5 and back again to Slide 1,2,3,4,5 continuously.
it works by using auto. however the rotation is Slide 1,2,3,4,5 but during back to Slide 1, it shows the 4,3,2,1 first. how to make it directly back to Slide 1 ?
during changing from slide 10 back to slide 1 again, it is ‘scrolled’ you can see slide 9,8,7,…1 fast enough/flicker, which i dont want. it is not directly changed from 10 to 1.
here is the fiddle, if you see until slide 10, it goes back to slide 1, but it is ‘scrolling’ from slide 9,8,… which i dont want to see it. i wiould like it goes from slide 10 rotate to slide 1 directly…
Hi, you were in the right path with loop: true, all you need to do is add the amount of slides to loop:
var swiper = app.swiper.create('.swiper-container', {
speed: 1500,
//slidesPerView: auto,
// If set to true, its mandatory to specify slides to loop.
loop: true,
// Add the slides to loop
loopedSlides: 10,
autoHeight: true,
shortSwipes: false,
longSwipes: false,
//effect:'fade'
//spaceBetween: 100
});
loop boolean false
Set to true to enable continuous loop mode
If you use it along with slidesPerView: ‘auto’ then you need to specify loopedSlides parameter with amount of slides to loop (duplicate)
Also, because of nature of how the loop mode works, it will add duplicated slides. Such duplicated classes will have additional classes:
swiper-slide-duplicate - represents duplicated slide
swiper-slide-duplicate-active - represents slide duplicated to the currently active slide
swiper-slide-duplicate-next - represents slide duplicated to the slide next to active
swiper-slide-duplicate-prev - represents slide duplicated to the slide previous to active
loopAdditionalSlides number 0 Addition number of slides that will be cloned after creating of loop
loopedSlides number null If you use slidesPerView:‘auto’ with loop mode you should tell to Swiper how many slides it should loop (duplicate) using this parameter
loopFillGroupWithBlank boolean false Enable and loop mode will fill groups with insufficient number of slides with blank slides. Good to be used with slidesPerGroup parameter