A modern lazy loading library for images.
Patch:
dist
files, via new build systemUpdate README to accommodate the license change.
Change license back to MIT.
Upgraded build system.
Hat tip to Rich Harris - switching from browserify to rollup shrank the processed dist
file from ~4kb to ~2.5kb.
Specify GPL license version (3.0).
Change license to GPL.
Fix initial scroll position bug, preventing images in the initial viewport from loading (another find by @ndimatteo).
Fix bug in threshold calculation (good find by @ndimatteo).
Layzr has been completely rewritten in ES6. The source code has a much more functional feel to it, and it includes an updated build system.
It is still small, fast, and purely vanilla JavaScript. Please read through the new README after reviewing the list of changes below:
srcset
supportCONTRIBUTING.md
container
option (assumed to be the window
)selector
option (assumed to be the new data-normal
attribute)data-layzr-bg
option (can be replicated using the new event emitter)data-layzr-hidden
option (replaced by the new update
API method)callback
option (replaced by the event emitter)destroy
method. Big thanks to @mauriciosoares and @NeXTs.