Answer the question
In order to leave comments, you need to log in
How to make an event when scrolling to a certain element?
How to make an EventListener when scrolling until a certain element appears on the page? I only mastered the scroll in pixels, but this is not accurate, since the screen sizes can change. Third-party libraries are not needed, how to do it in JS?
Let 's say I have this.scrolled = window.scrollY > 100;
codepen.io/kodekrendel/pen/vmYeew now.
How can I make this event fire when I scroll to h2, for example?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question