nolimits4web / swiper

Most modern mobile touch slider with hardware accelerated transitions
https://swiperjs.com
MIT License
39.67k stars 9.75k forks source link

Lazy Loading and Fade Effect #7469

Open salomanov opened 5 months ago

salomanov commented 5 months ago

Check that this is really a bug

Reproduction link

https://codesandbox.io/p/sandbox/swiper-lazy-load-images-fade-4mrgh8?file=%2Findex.html

Bug description

When using the "Fade" effect, all slides appear in the viewport, although they are hidden, so all images begin to load, although lazy loading is selected.

Expected Behavior

No response

Actual Behavior

No response

Swiper version

v11.1.1

Platform/Target and Browser Versions

Windows, Chrome

Validations

Would you like to open a PR for this bug?

salomanov commented 5 months ago

https://github.com/nolimits4web/swiper/issues/6582#issuecomment-1510904926 This method doesn't help

solidblackt commented 5 months ago

Correct, it's not working #6582.

Also, lazy load is not working with width:100% on the img tag. on page load it's loading first two image which is caused the issue.

lkaisers commented 5 months ago

Experiencing the same issue.

saas786 commented 2 months ago

For me, the solution provided in https://github.com/nolimits4web/swiper/issues/6582#issuecomment-1510904926 GitHub comment does help.

However, if this fix is required for the fade effect to work by default, it should be included in the core CSS. It took me some time to figure this out.