Fade and scroll items into view while scrolling

Kevin Powell on YouTubeWatch on YouTube

SaveMark complete

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

IntermediateUI17 min

About this video

Shows how to use the Intersection Observer API with JavaScript and CSS to detect when elements enter the viewport and animate them into view with a fade and slide as the reader scrolls. It suits people who already write some HTML and CSS.

What you’ll learn

  • Detect when page elements enter the viewport with Intersection Observer
  • Animate elements to fade and slide into view on scroll
  • Toggle CSS classes from a JavaScript callback to trigger transitions