Submit your widget

jQuery images Lazy Load plugin

Created 10 years ago   Views 13578   downloads 1804    Author luis-almeida
 jQuery images Lazy Load plugin
View DemoDownload
Share |
This  is very useful and it boosts performance delaying loading of images in long web pages because images outside of viewport (visible part of web page) won't be loaded until the user scrolls to them.
Lazy Load has some cool options such as custom effects, container, events or data attribute. If you're not gonna use any of them you can reduce the file size by leaving just the essential code to show the images.
Use a placeholder image in the src attribute - something to be displayed while the original image loads - and include the actual image source in a "data-src" attribute.
If you want to serve high-resolution images to devices with retina displays, you just have to include the source for those images in a "data-src-retina" attribute.
You don't need to include a "data-src-retina" attribute in all the image tags, unveil is smart enough to fallback to "data-src" or even do nothing in case there isn't any "data-src" specified.
<img src="bg.png" data-src="img1.jpg" /> 
<img src="bg.png" data-src="img2.jpg" data-src-retina="img2-retina.jpg" />

Read more: