-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Load only when visible #201
Comments
lazysizes does not load all images lazily, only images that are less than 500-750 pixel away from the viewport. If you lower this to 0, the user has to wait for images as soon as he scrolls into this area. You can modify the window.lazySizesConfig = window.lazySizesConfig || {};
window.lazySizesConfig.expand = 10; //default 360-500
lazySizesConfig. expFactor = 1.5; //default: 1.7 Please close if this helps. |
But why are images still loaded, even they are not in viewport and not visible? You can check it in chrome browser (network tab). My config:
|
The folowing config doesn't make sense: window.lazySizesConfig.srcAttr = "src";
window.lazySizesConfig.srcsetAttr = "srcset";
window.lazySizesConfig.sizesAttr = "sizes"; Your markup should not include the actual image(s) inside the |
Thanks, this was very important for me.. lazysizes works. Two cases:
|
lazysizes already does this by default. see here: #284 (comment) |
Hi,
Thanks for the great work I have a slightly different requirement. We have a single page website and most images are on the bottom section of the page which is visited very rarely. Hence, we really don't want to load images (even in lazy mode) unless user views that part of the page (either by scrolling or by clicking internal link). To make it a generic requirement, Is it possible to load images only when image elements are in visible portion of the browser.
Thanks
The text was updated successfully, but these errors were encountered: