flickity icon indicating copy to clipboard operation
flickity copied to clipboard

Feature request: Support native loading=lazy image attribute

Open HLeithner opened this issue 3 years ago • 2 comments

It would be great to support the native lazy loading attribute at least for images.

We have a browser support of 74.96% at this time, only the new IE (Safari) doesn't support it in the current version. But it's already in the Technology Preview and should be in the next major update of MacOS and IOS.

Data based on https://caniuse.com/loading-lazy-attr

In addition I hope it's possible to make this work with also with the picture element.

Resources: https://developer.mozilla.org/en-US/docs/Web/Performance/Lazy_loading https://html.spec.whatwg.org/multipage/urls-and-fetching.html#lazy-loading-attributes

HLeithner avatar Dec 14 '21 10:12 HLeithner

Add a 👍 reaction to this issue if you would like to see this feature added. Do not add +1 comments — They will be deleted.

desandro avatar Dec 21 '21 20:12 desandro

It's a nice feature. Having said that, at this point the current lazyload works better. The browsers don't properly determine the amount of images that need to be preloaded - yet

Note: I believe it's not recommended to use native lazyload on the first visible images. That may be difficult to implement.

dijkermans avatar Feb 17 '22 09:02 dijkermans