Jump to content
bedak

lazy images - attribute `loading`

Recommended Posts

Would be nice to have the possibility to add the (new) attribute `loading` to images and/or iframes.

<img loading="lazy" src="..." alt="" />

Just adding this attribut with the value "lazy" saves megas on pages with lots of images, esp. on smartphones (where images are often displayed in 1 column), 
- without any lazy-loader Js-lib!
Browser-Support: https://caniuse.com/#search=loading

Share this post


Link to post
Share on other sites

I agree that’s a great feature, but what is your request exactly?

Share this post


Link to post
Share on other sites

I think this can already be used, since it actually only affects the front-end.

And the front-end is created by the developer anyway 😉 

Share this post


Link to post
Share on other sites

@bedak might be referring to images in CKEditor fields, which would all probably benefit from being lazy loaded.

By the way, it looks like we developers should not be using the "loading" attribute on iframes until it's part of the spec. Yes, Chrome has implemented it, but they went ahead as usual without much consideration for cross-browser interoperability ("innovation first, standards later" seems like their M.O., even if that's caused problems a few times before).

Quote

Please note <iframe loading=lazy> is currently non-standard. While implemented in Chromium, it does not yet have a specification and is subject to future change when this does happen. We suggest not to lazy-load iframes using the loading attribute until it becomes part of the specification.

 

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...