/lazyload-image

HTMLImageElement extension for lazy loading.

Primary LanguageJavaScript

Photo by Susana Fernandez

About

HTMLImageElement extension for lazy loading. Images will be loaded when they are shown.

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.

License

MIT: http://1000ch.mit-license.org