🔔 Alert..!! Get 2 Month Free Cloud Hosting With $200 Bonus From Digital Ocean ACTIVATE DEAL

lazy.js is a very small jQuery lazy load plugin which can be used to save load time and data usage by avoiding downloading images that are out of the viewport.

lazy-load

Documentation

lazy-loads

lazy loads with jQuery

Demo

codepen demo

usage

JS

/**  * lazyLoad(animationDuration,windowPosition, opacityLevel) * * animationDuration: int * windowPosition: int * opacityLevel: decimal  */  $(document).ready(function(){ 		lazyLoad(1000,window.innerHeight, 1); })  $(document).on('scroll touchmove',function(){ 	lazyLoad(1000,window.innerHeight, 1); }); 

HTML

<img class="lazy-img" alt="test" data-awake="false" data-img-src="img.jpg">

You May Also Like