E
E
Edward2019-02-06 14:51:48
Frontend
Edward, 2019-02-06 14:51:48

How to use the intersection Observer polyfill?

When optimizing a site for google pageSpeedInsight, you have to lazy load images (using the intersection Observer). But IE does not support this technology. I know that there is a polyfill that solves the compatibility problem, but I don't know how to use it in practice. That is, how and where to connect it and how. I would be grateful if someone could explain to the "teapot".

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dima Polos, 2019-02-06
@dimovich85

Yes, everything seems to be simple: https://github.com/w3c/IntersectionObserver/blob/m...
It can be done as jquery - I connected the script before all other scripts and that's it. If you use webpack, then they write through require to connect before all dependencies.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question