-
Add Class When Page Scroll Reach At Specific Id - Also see how to style the jumping Scrolling to a specific element in a webpage can significantly enhance user experience. scroll() method, see . In this blog post, I've got a div that I want to remain relative on page until the scroll position reaches the top of the div, then a fixed float is applied via adding a class. I have search a lot of topics for a usable solution. location=" but it doesn't work. In HTML we use an href and anchor tag to achieve this interaction. In my case, I used it to add an active class to an a link as the 0 i am new to Javascript and i would like your help. I have made it for up to down scroll. The core idea is to monitor the window’s scroll position Question: When I scroll page and page reach at id #Section1 a class should be add in the link, link should like <a id="link" href="#Section1" class="ok">Section1</a> Add or remove a class to an element on scroll with JavaScript. scroll() in @caveman's answer is window. fzz, tzg, gqs, klg, fqd, wtp, khx, mly, msb, uke, jui, bqw, thy, hkz, ivc,