Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lazy loading visible images but not working on scroll #158

Open
volkan-umg opened this issue Nov 30, 2017 · 2 comments
Open

Lazy loading visible images but not working on scroll #158

volkan-umg opened this issue Nov 30, 2017 · 2 comments

Comments

@volkan-umg
Copy link

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:

<script> (function() { var bLazy = new Blazy({ selector: 'img' }); })(); </script>

Is it supposed to work for lazy loading on scroll out of the box or does it require more configuration?

Thanks.

@rajesh1158
Copy link

I read in the documentation that we need to call bLazy.revalidate(). I tried this but still does not work.

@RyanBertrand
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants