Intersection Observer API

shrey vijayvargiya - Oct 8 '22 - - Dev Community

Did you read about it?

It helps to track the element viewport with respective to the root.

I mean when we scroll Youtube app on our phone the video automatically starts as soon as it comes in the viewport so how to add these features?

It can be achieved using Intersection Observer API and we can add lazy-loading and infinite scrolling using this API.

What you think?

Intersection Observer API

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .