This is a very old issue but has not yet been fixed.
Currently, it is not possible to use lazy load + slidesPerView:"auto" together. :(
--
[ ] feature-discussion (RFC)
Swiper Version: v6.3.5
Tried to use lazy loading with slidesPerView: "auto".
var mySwiper = new Swiper(".swiper-container", {
slidesPerView: "auto",
preloadImages: false,
watchSlidesProgress: true,
watchSlidesVisibility: true,
lazy: true,
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev"
}
});
You can see this at https://codepen.io/mrWilson123/pen/JjKQEKj
You can also change slidesPerView: "auto" to slidesPerView: 2 and you will see images lazy load correctly, and the navigation works again.
Same with issue 1679.
Yes, but it doesn't help me further. As you can see, this problem has existed for years. There is still no solution.
add this to your options:
on: {
lazyImageReady: (swiper) => {swiper.update()}
}
-> https://github.com/nolimits4web/swiper/issues/3929#issuecomment-723056648
Thank you, @moevbiz. Your answer was very helpful. It seems to be working now. 馃憤
Most helpful comment
add this to your options:
-> https://github.com/nolimits4web/swiper/issues/3929#issuecomment-723056648