576 B
576 B
img lazy loading in html
To implement Lazy Loading to an <img ... >
tag, add the attrbitue loading=lazy
<img loading=lazy ... >
This will load the image when scrolling is near the viewport, using the Intersection Observer API
Further reading
What led to learning this
- Accidentally: a rabbit hole that started at Jason Crawford's github and ended at https://github.com/owid/owid-grapher/pull/422