Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document browsers supported? #435

Open
sheffieldnikki opened this issue Apr 27, 2019 · 1 comment
Open

Document browsers supported? #435

sheffieldnikki opened this issue Apr 27, 2019 · 1 comment

Comments

@sheffieldnikki
Copy link

sheffieldnikki commented Apr 27, 2019

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
Copy link
Author

sheffieldnikki commented Apr 27, 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)};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant