THIS IS A FORK: of the original by Danilo Bilanoski, updated to allow the sections to be placed inside a relative parent. See the JS file comments for details.
ORIGINAL: Simple Vanilla Javascript solution to highlight an active menu item / navigation link when scrolling the page without the need for jQuery. Idea is to watch scroll position and add a certain CSS class to active menu item when you scroll to corresponding section.
A Pen by khuongyolo on CodePen.
Using this fork as a code on https://webshopchecker.nl/shop/bol-com/ , but found out the code results in Anchor links not working anymore in Google Chrome and Edge.
On Safari it works fine. How to solve?