The freeCodeCamp Forum
How to target only first and last intersected elements with Intersection Observer?
JavaScript
Snippet
April 7, 2023, 12:40am
1
Something like
if (entry.isIntersecting) { if(entry.isIntersecting[0]) { // do your thing } }