Javascript Observers - Part 2 - Intersection Observer

preview_player
Показать описание
The Intersection Observer API is a JavaScript interface that allows you to efficiently detect when an HTML element intersects with another element or the viewport. It provides a powerful tool for building performant web applications, especially those that involve lazy loading of images or infinite scrolling. With the Intersection Observer API, you can detect when an element becomes visible or hidden and take appropriate actions. This can help reduce the amount of unnecessary computation and network usage, leading to faster and more efficient websites.

This video is part of a series where we look at JS Observers in detail.

⌚Timestamps
0:00 - Intro
0:36 - The Intersection observer API
1:21 - Creating an observer
1:48 - Options object
3:33 - Observing the target element
4:26 - Intersection entry
10:16 - Adding options
15:42 - Unsubscribe observer
17:25 - Infinite scrolling example
19:54 - Outro

🧑‍💻Other playlists:

Socials

#intersectionobserver #dom #mutation
Рекомендации по теме