Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vanilla-lazyload

Package Overview
Dependencies
Maintainers
1
Versions
148
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vanilla-lazyload - npm Package Versions

1
15

14.0.0

Diff

Changelog

Source

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!


Version 13

verlok
published 13.0.1 •

Changelog

Source

13.0.1

  • Fixed a JS error that could happen to IE11 users after going offline and back online
  • Minor refactoring for better readibility and lighter code (and files)!
verlok
published 13.0.0 •

Changelog

Source

13.0.0

  • Added the minified version of 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"
  • Reduced files weight even more! dist/lazyload.iife.min.js now weights only 2.03 KB GZipped
  • Removed the callback_set callback that was deprecated since version 11 in favour of callback_reveal
  • Removed sourcemaps (they were probably used only by the authors, but if anyone was actually needing them, we can bring them back)
  • Hidden the _extends function inside LazyLoad's scope (it was global before)
  • Updated build tooling: removed Gulp, now using Rollup & Babel only

Version 12

verlok
published 12.5.1 •

Changelog

Source

12.5.1

Restored IE 11 compatibility, which was broken since 12.2.0. See #414. Thanks to @ninosaurus for reporting.

verlok
published 12.5.0 •

Changelog

Source

12.5.0

The once-private _loadingCount property is now public and renamed to loadingCount. This property contains the number of images that are currently downloading from the network, limitedly to the ones managed by an instance of LazyLoad. This is particularly useful to understand whether or not is safe to destroy an instance of LazyLoad. See implementation in the destroy demo.

Thanks to @wzhscript and @eugene-stativka.

verlok
published 12.4.0 •

Changelog

Source

12.4.0

Video posters can now be loaded lazily, as requested in #365

verlok
published 12.3.0 •

Changelog

Source

12.3.0

Callbacks now pass more arguments!

callback_enter, callback_exit now pass:

  1. the DOM element that entered / exited the viewport
  2. the IntersectionObserverEntry that triggered the enter/exit event
  3. the LazyLoad instance

callback_load, callback_error, callback_reveal now pass

  1. the DOM element that entered / exited the viewport
  2. the LazyLoad instance

callback_finish now passes:

  1. the LazyLoad instance

The README file has been updated accordingly.

verlok
published 12.2.0 •

Changelog

Source

12.2.0

Released new feature "retry when back online". Now if your users lose the internet connection causing errors on images loading, this script tries and loads those images again when the connection is restored.

verlok
published 12.1.1 •

Changelog

Source

12.1.1

Solved a bug with Internet Explorer 11 and the W3C polyfill, as reported in #383.

verlok
published 12.1.0 •

Changelog

Source

12.1.0

  • Updated npm dev dependencies
  • Added the new image_ph_inline.html, with an inline SVG placeholder
  • Added the new image_ph_external.html, with an external SVG placeholder
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc