blazy
blazy copied to clipboard
Lazy loading visible images but not working on scroll
When my page loads 2 images are visible and I can see the placeholders being replaced by the actual images. There are 2 more further down the page but when I scroll down they are never replaced. For testing purposes I'm using the same img element for all 4 images:
<img data-src="/img/test-images/test-large-2.jpg" src="/img/test-images/test-large-placeholder.jpg" />
This is how I initialize blazy:
Is it supposed to work for lazy loading on scroll out of the box or does it require more configuration?
Thanks.
I read in the documentation that we need to call bLazy.revalidate().
I tried this but still does not work.
If your images are in a scrolling container, you will need to add the container key to the init.
container: '#scrolling-container' // Default is window