Turn on debug line for better understanding how script behaves.
Turn off default link option, to disable highlighting menu point when e.g. banner is in view
Turn on update hash option to update hash accordingly to current section.
Change distance from top, into value best suiting your site.
If section doesn't have id and according nav point, last matched section will keep active status
Script also has a functionality to set classes on current sections.
The class set on section can be changed with sectionActiveClass property.
The classes inside navigation also can be changed through the navLinkActiveClass property.
This section doesn't have according menu point.
It is here to make it easier to undestand, how exact matching option works. - It's best place to try it.
If hash updating is enabled, you have the option to either retain the last hash value or set it to false, if no hash updates should occur between sections.
If no section was matched, you can choose
another default anchor to gain class "active".
This has
to be used together with default link option
Script has even more options, that weren't included in this small sample
callbacks onInit and onChange
You can select the parent of the anchor tags to become the 'active' class instead of the anchor tags themselves. To achieve this, specify the parent elements to be used as 'active' class holder inside parentsObtainingActiveClass property.