callmecavs / layzr.js

A modern lazy loading library for images.

Home Page:http://callmecavs.com/layzr.js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IntersectionObserver API Support

keithws opened this issue · comments

Do you have any plans to support the IntersectionObserver API? It is supposed to be more performant than Element.getBoundingClientRect() and is becoming widely supported.

will likely update this lib at some point, if i find the time

if you want to use IntersectionObserver for the time being, check out obzerv. it tracks elements relative to the viewport in a more general sense. there's an example on the README that shows how to load an image lazily