lazyload
lazyload copied to clipboard
Document browsers supported?
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)
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)};