github verlok/vanilla-lazyload 14.0.1
Version 14.0

latest releases: 19.1.3, 19.1.2, 19.1.1...
4 years ago

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 loading
  • callback_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 elements
  • destroy() 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

  • 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 the data-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 to observing, but managed by native lazy loading).

Love this project? 😍 Buy me a coffee!

Don't miss a new vanilla-lazyload release

NewReleases is sending notifications on new releases.