lazyLoadingInPrevNextAmount not preloading images with lazy loading
See original GitHub issueI’ve been trying to get the recently implemented lazyLoadingInPrevNextAmount
option to work but so far it seems to have no effect.
I have tested this with the latest 3.3.1 version of Swiper and it still doesn’t work. I have set up an example here: http://codepen.io/anon/pen/gPQqGQ
If I open the Chrome inspector and watch the network tab, I can see only a couple of images are downloaded (ie. the ones that are in view). Then it just waits and no more images download. When I scroll, images are downloaded as they come into view but this is too late - I would like to have it always loading several images ahead to avoid the noticeable delay each time a new image appears.
Here is my configuration for reference:
var swiper = new Swiper('.swiper-container', {
direction: 'horizontal',
slidesPerView: 'auto',
spaceBetween: 10,
mousewheelControl: true,
mousewheelSensitivity: 1,
freeMode: true,
preloadImages: false,
lazyLoading: true,
watchSlidesVisibility: true,
lazyLoadingInPrevNext: true,
lazyLoadingInPrevNextAmount: 5
});
Is this a bug or am I doing something wrong? I saw a mention in other issue that someone else was having the same problem so I don’t think it’s just me.
Any help would be appreciated! This script is amazing and it’s so close to being perfect for what I need. Many thanks!
Issue Analytics
- State:
- Created 8 years ago
- Reactions:3
- Comments:9 (2 by maintainers)
Hi Vladimir,
I was wondering if there is any update on this? I imagine you’ve got a lot on your todo list so no pressure, just hoping to get an idea of a possible timeframe since I’d like to use Swiper in a project that is launching soon.
Thanks!
If anyone is looking for an alternative until this is implemented, check out the excellent Lazysizes plugin: http://afarkas.github.io/lazysizes/