intersection-lazyload

1.1.0 • Public • Published

Intersection Lazyload

npm version

Installation

npm install --save intersection-lazyload

Note: This library is based on the IntersectionObserver API, it's not yet widely supported.
Check the compatibility table and add a Polyfill to your needs!

Usage

Import the module in your application:

// From ES6
import lazyload from 'intersection-lazyload'
 
// From CJS
const lazyload = require('intersection-lazyload').default;
 
// From global
const lazyload = IntersectionLazyload.default;

Then use it juste like that:

<img class="--lazyload" data-src="your-picture.png">
lazyload();

Run the test

npm test

Example

Check out the documentation.

Package Sidebar

Install

npm i intersection-lazyload

Weekly Downloads

0

Version

1.1.0

License

MIT

Last publish

Collaborators

  • samouss