-
-
Notifications
You must be signed in to change notification settings - Fork 676
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
Compatibility with loading attribute #331
Comments
Hey @ryuran, I was already thinking about it... I don't think it's possible, because <img src="celebration.jpg" loading="lazy" alt="..." />
<iframe src="video-player.html" loading="lazy"></iframe> I'm assuming that if the Anyway I'm going to read Addy's post through and see if it can be done somehow. Thank you for the hint! |
Hey, I've read Addy's article till the end, and YES, I think it's totally doable like he suggests, even if that solution means that your content would still rely on some JavaScript code to start loading. (so what’s the point?) I'm going to add a new option, something like (*) big question: set the default value to |
I lean forward |
@addyosmani Could you suggest a solution here? |
I guess that since the native |
If you want to take a look, I'm already developing it in the feature/nativeLazyLoading branch. ;) |
I've added a new demo in the master branch, already deployed and made available online on my website, in order to test native lazy loading for images. This demo doesn't require any Javascript code, it's just to try how it works. As far as I can see, Chrome is downloading images all the way down even if the user didn't scroll by any pixel. This is NOT the same goal that this script aims to pursue. The main difference is that, using this LazyLoad script, the images outside of the viewport (plus the So yes, I can continue developing this feature, but I think that in the end nobody would use it, since the final result would be very different. What do you think? |
So scripted lazy loading is images outside of the viewport are not downloaded at all. |
Not sure. @addyosmani knows better I guess. Addy? |
From the spec, the native lazy loading should
Also to note
This is used to fetch the images dimensions and prevent any content reflow. |
Thank you @Tabrisrp. That’s why then. The images in that demo are very light so... they are fetched all at once. Good to know! I’ll keep going with the implementation. |
Just released 12.0 BETA. |
You can install it locally via npm:
Or include it in your page via script: <script src="https://cdn.jsdelivr.net/npm/vanilla-lazyload@12.0.0-beta.0/dist/lazyload.min.js"></script> |
Hey folks. Sorry for the slow reply here. I've been silently pushing updates to my article about how our current implementation in Chrome works. We're still in the process of figuring out a number of details and
I would personally label any use of |
Thanks @addyosmani I've also marked version 12 of this script as beta and made the feature active only under a setting ( Thanks! |
Hello,
Addy Osmani, write here https://addyosmani.com/blog/lazy-loading/ about new loading attribute.
The text was updated successfully, but these errors were encountered: