LazyLoad

darkwing/LazyLoad.

LazyLoad should be initialized during the DOMReady event. There are no required arguments — only options.

#JS
/* LazyLoad instance */
var lazyloader = new LazyLoad({
    range: 200,
    realSrcAttribute: "data-src",
    useFade: true,
    elements: 'img',
    container: window
});

#HTML
<img src="http://davidwalsh.name/dw-content/blank.gif" data-src="http://davidwalsh.name/dw-content/mexico-2009/small/102_1152.jpg" />
<!-- or -->
<img data-src="http://davidwalsh.name/dw-content/mexico-2009/small/102_1152.jpg" />

http://davidwalsh.name/js/lazyload

 

 

 

 

 

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s