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.