Skip to content

emflores/lazy-load

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lazy Load NPM version

Efficient and small, load your images lazily without messy jQuery plugins.

Required DOM Structure

<img src="/baz.png"> <!-- will not be lazy loaded -->
<img class="lazy-load" data-src="/foo.png">
<img class="lazy-load" data-src="/bar.png">

Initialization

lazyLoad.init( imageSelector, imageSourceAttribute );

Initializes lazy load. Can optionally pass in:

imageSelector

The class representing the image/images that you would like to lazy load ( .lazy-load by default ).

imageSourceAttribute

Attribute on the image element that holds the image source ( data-src by default ).

About

Lazy load your images

Resources

Stars

Watchers

Forks

Packages

No packages published