This code will automatically add and remove a class based on scroll position using vanilla JavaScript. In my case, I used it to add an active class to an a link as the user scrolled down the sections on my site.
Get the code here: https://permaslug.com/add-a-class-bas...
-- More --
Join this channel to get access to sweet perks for comments and during live streams and premiers: / @permaslug
Website: https://permaslug.com