vanilla-lazyload
Advanced tools
Changelog
14.0.0
🎉 Major refactoring and performance improvement! 🔍 File size stays tiny: only 2.07 KB gZipped
Settings
callback_loading
is called when an element started loadingcallback_reveal
is now ⚠ DEPRECATED, use callback_loading
instead (it's the same thing, it was just renamed). callback_reveal
will be removed and will stop working in version 15.Instance methods
update()
method now also unobserves deleted elements, instead of just looking for and observing new elementsdestroy()
destroys better than it did before, delete
-ing properties instead of setting their values to null
load()
method (as an instance method) is now ⚠ DEPRECATED, use the static method instead. If you were using aLazyLoadInstance.load(element)
you should change it to LazyLoad.load(element, settings)
.Static methods
load()
was added as a static method. Note that if you need to use custom settings, you need to pass them in the settings
parameter.Instance properties
toLoadCount
. It's the counter of the elements that haven't been lazyloaded yet.DOM
data-was-processed
attribute, that was added to mark lazy DOM elements as "already managed". If you were manually handling that attribute to obtain some goal, this is a potentially breaking change. You should now refer to the data-ll-status
instead.data-ll-status
attribute, which is now used to mark the status of a lazy DOM element. The values it can take are: observing
(not loaded yet), loading
(loading started), loaded
(load completed), error
(an error has occured), native
(similar to observing
, but managed by native lazy loading).Love this project? 😍 Buy me a coffee!
Changelog
13.0.0
dist/lazyload.esm.js
as dist/lazyload.esm.min.js
, so now you can effortlessly use it with an ES module import
statement when using type="module"
dist/lazyload.iife.min.js
now weights only 2.03 KB GZippedcallback_set
callback that was deprecated since version 11 in favour of callback_reveal
_extends
function inside LazyLoad's scope (it was global before)Changelog
12.1.1
Solved a bug with Internet Explorer 11 and the W3C polyfill, as reported in #383.
Changelog
12.0.0