Fast High-Performance Lazy Load Library – LazyObserver.js

Category: Image , Javascript , Loading | March 2, 2018
Views Total:278 views
Official Page:Go to website
Last Update:March 2, 2018


Fast High-Performance Lazy Load Library – LazyObserver.js


Just another JavaScript library which makes uses of the Intersection Observer API to provide the fast, performant and modern lazy loading functionality on your images within the document. Supports both <img> tags and background images.

How to use it:

Install and import the LazyObserver.js library into your document.

$ npm install lazyobserver --save
<script src="/path/to/LazyObserver.js"></script>

Initialize the lazyobserver library and specify the selector of the container which contains images and/or background images.

// default .lazyObserver
new LazyObserver('.lazyObserver');

Default configs.

new LazyObserver('.lazyObserver',{
    root: null,
    rootMargin: '0px 0px 0px 0px',
    threshold: 1.0,
    mounted: null, 
    loaded: null,
    error: null

You Might Be Interested In:

Leave a Reply