14.0.1
- Fixed error TS1036: Statements are not allowed in ambient contexts. Closes #427
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, usecallback_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 tonull
load()
method (as an instance method) is now ⚠ DEPRECATED, use the static method instead. If you were usingaLazyLoadInstance.load(element)
you should change it toLazyLoad.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 thesettings
parameter.
Instance properties
- Added
toLoadCount
. It's the counter of the elements that haven't been lazyloaded yet.
DOM
- Removed the
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 thedata-ll-status
instead. - Added the
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 toobserving
, but managed by native lazy loading).
Love this project? 😍 Buy me a coffee!