lazyload icon indicating copy to clipboard operation
lazyload copied to clipboard

Document browsers supported?

Open sheffieldnikki opened this issue 5 years ago • 1 comments

Be great if the documentation mentioned which browser versions are supported by v2.x. AFAIK it requires IntersectionObserver for lazy loading, and it falls back to loading all the images immediately on older browsers?

I haven't tested these all myself:

  • Internet Explorer - no
  • Microsoft Edge 15+ (2017)
  • Chrome 51+ (2016)
  • Firefox 55+ (2017)
  • Safari 12.1+ (2019)

See https://caniuse.com/#feat=intersectionobserver

sheffieldnikki avatar Apr 27 '19 20:04 sheffieldnikki

A useful polyfill for older browsers is https://github.com/w3c/IntersectionObserver/tree/master/polyfill which can be included with: <script src="https://polyfill.io/v2/polyfill.min.js?features=IntersectionObserver"></script>

or to only load the polyfill if needed:

if(!window.IntersectionObserver){ var ga=document.createElement('script');ga.type='text/javascript';ga.async=true; ga.src='//polyfill.io/v2/polyfill.min.js?features=IntersectionObserver'; var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(ga,s)};

sheffieldnikki avatar Apr 27 '19 20:04 sheffieldnikki