Introduction to the Intersection Observer JavaScript API

Kevin Powell on YouTubeWatch on YouTube

SaveMark complete

Sign in to save videos and track what you’ve finished.

BeginnerUI22 min

About this video

An introduction to the fundamentals of the Intersection Observer JavaScript API, showing how it watches elements entering and leaving the viewport. It also covers the threshold and rootMargin options and is aimed at people new to the API.

What you’ll learn

  • Explain how Intersection Observer detects elements entering or leaving the viewport
  • Set the threshold and rootMargin options to control when an observer fires
  • Use Intersection Observer in place of scroll event listeners