Skip to content

sebagr/lazyload-image

Repository files navigation

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

Photo by Susana Fernandez

Install

Install lazyload-image via npm or bower.

# via npm
$ npm install lazyload-image

# via bower
$ bower install lazyload-image

Usage

Load lazyload-image.html in your HTML.

<link rel="import" href="lazyload-image.html">

Modify your <img> elements such as following.

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

Fallback

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

License

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

About

HTMLImageElement extension for lazy loading.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HTML 77.4%
  • JavaScript 22.6%