lazyload-image

HTMLImageElement extension for lazy loading.

Fork me on GitHub

Usage

Load `lazyload-image.js` in your HTML.

<script src="lazyload-image.js"></script>

Modify your <img> elements such as following.

<img is="lazyload-image" src="path/to/your/image.jpg" width="100" height="100">

You can specify load offset.

<img is="lazyload-image" src="path/to/your/image.jpg" offset="200" width="100" height="100">

Fallback

If browser does not support document.registerElement(), Images will be loaded as usual.

Demo