aFarkas / lazysizes

High performance and SEO friendly lazy loader for images (responsive and normal), iframes and more, that detects any visibility changes triggered through user interaction, CSS or JavaScript without configuration.
MIT License
17.56k stars 1.73k forks source link

swiper slider off-screen images not "preloading" #959

Open nosilver4u opened 2 years ago

nosilver4u commented 2 years ago

Describe your problem/question We've run across a strange issue with a horizontal slider/swiper where the images don't get lazyloaded until after they come into the actual viewport. So far as I know, anything within the "expand" threshold should be loaded right away, but this is very obvious that the images never load until they comes onto the screen (excepting the handful that are on-screen from the start).

Make it reproduce-able This is on a client site that we didn't build, we're just providing the lazy load and CDN stuff, but I've slimmed down the page so the swiper is right at the top here: https://codesandbox.io/s/mystifying-butterfly-xmihcc?file=/index.html

Add tags/keywords expand, viewport threshold

Is this perhaps some quirk with the way the swiper is using the transform/translate3d effect to move the images? And is there any way you can see to improve it?