Skip to content

a light & tiny image lazyload script, use on mobile

License

Notifications You must be signed in to change notification settings

yangyuji/img-lazyload

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

img-lazyload

a light & tiny image lazyload script, support for dynamic loading of images

todo

  • load different image according to different retina screen

use

<img class="lazyload" data-src="./w375.jpg" alt="">
...
window.addEventListener('load', function(e) {
   new lazyload({
       lazyClass: '.lazyload',
       lazyAttr: 'data-src',
       lazyLoaded: function (img) {
           img.classList.add('lazyloaded');
       }
   });
}, false);

preview

About

a light & tiny image lazyload script, use on mobile

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published