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
Intersection Observer not working in Internet Explorer 11 #383
Comments
Hi @zmrhaljiri, It’s not a bug, it’s designed to work like this. If the browser doesn’t support IntersectionObserver, it loads all the images to make users see the images anyway. If you require the same exact behaviour also in IE11, you should load a polyfill before loading LazyLoad. Find out how in the documentation (README file). Before doing that, please consider that IE11 is not maintained anymore, and analyse how many users of your website browse it with IE11. |
Hello @verlok, You are right, if the browser doesn't support Intersection Observer, then all the images are loaded. But if I understand it correctly, if the polyfill is loaded before LazyLoad is loaded, then it should work fine. Is that correct? On the example page, you can see that the Intersection Observer polyfill is loaded before LazyLoad, so it should not load all the images at once, am I right or missing something here, please? (Using IE11 is not my decision, I just have to :)) |
Hi @verlok @zmrhaljiri The last two tests are failing when using the w3c intersection-oberserver:
For a quick solution I downgraded from version 12.1.0 to 12.0.1 with:
When I import the library I also need to use |
Thanks for pointing this out. |
Could you please tell me which version of the intersection observer polyfill you are using? |
@verlok Sure, I'm using the latest one 0.7.0. They seem to assign those properties in the constructor of IntersectionObserverEntry, not via prototype, that's why the lookup in the prototype is failing. https://github.com/w3c/IntersectionObserver/blob/master/polyfill/intersection-observer.js#L64 |
Solved with 12.1.1 |
Many thanks :) |
Describe the bug
When opening a page in Internet Explorer 11 with the Intersection Observer polyfill + lazyload libraries included, all lazy images (including background) are loaded at once on page load.
To Reproduce
Steps to reproduce the behavior:
Example 1: Normal images
Example 2: Background images
Expected behavior
Images are loaded only when they enter a viewport.
LazyLoad version
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: