1.1.0 • Published 7 years ago
intersection-lazyload v1.1.0
Intersection Lazyload
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.