Lazyload
- Loaded images of lazy loading components.
- Compatible with IE7 + browser.
- Allow custom loading style.
Use
2.1 Html
- html set the
data-src
property. data-cover
is not necessary
2.2 Import ./dist/Lazyload.js
file to the page
or
let Lazyload = ;
2.3 Initialization
//Get elementsvar eList = ;eListpush;eListpush; //Create Lazyvar lazy = obj:eList //elements range:200 //Extra range; // //custom tips// lazy.tips = function(obj){// var e = obj.o, //element// schedule = obj.schedule; //load schedule// console.log(e,schedule);// }; //Initlazy;
Npm
npm install image-lazyload
let imgs = document lazy = obj:imgs range:200 ; lazy;
Demo
License
MIT