Here’s a secret: You may not need
scrollevents in your next app. Using an
IntersectionObserver, I show how you can fire a custom event when
position:stickyelements become fixed or when they stop sticking. All without the use of scroll listeners.
One of the practical limitations of using CSS sticky position is that it doesn’t provide a platform signal to know when the property is active. In other words, there’s no event to know when an element becomes sticky or when it stops being sticky.