Using IntersectionObserver with a threshold

Here we've added a threshold to IntersectionObserver. Our video will play once 75% of it has scrolled into the viewport and stop more than 25% scrolls out of the viewport.

Video track by Tiffany B. Brown (that's me!), © 2023. I recorded it in May of 2023 while riding the Teleféric del Port facing Montjüic heading towards Barceloneta.

Audio track: "Doctor Dreamchip - Lofi Keyboard Pack - Rhodes80BPM C Major - 12.wav" by Doctor_Dreamchip is licensed under CC BY 4.0 .

Back to the post