Skip to content

EleanorMao/lazyload.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lazyload.js

lazy load imgs demo

support

  • √ ie8 ~ ie11
  • √ edge
  • √ firefox4+
  • √ chrome26+

usage

  <img data-imgsrc="https://avatars2.githubusercontent.com/u/15724170?v=4&s=40">
<script src="./lazyload.min.js"></script>
<script>
  lazyload()
 </script>

options

{
  cover: '',
  duration: 300,
  coverColor: 'rgba(0,0,0,.4)',
  onLoadEnd: function (element, index) {},
  onLoadError: function (element, index) {},
  onLoadStart: function (element, index) {},
  defaultImg: 'data:image/png;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=='
}