Jump to content

lazy images - attribute `loading`


bedak
 Share

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

Link to comment
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
Link to comment
Share on other sites

  • 4 months later...
On 4/23/2020 at 1:03 PM, jacmaes said:

@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).

 

Yes, I had CKEditor in mind or an additional option within the fieldtype 'images'.
And thanx for your information about not using the "loading" attribute  on iFrames!

Link to comment
Share on other sites

  • 2 years later...

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...