Please explain exactly what it is you’re trying to do. Is the intention maybe to make the page scroll to a section when a nav menu option is clicked? Or that the page should scroll to that section automatically when the page is accessed with different addresses (urls)?
Right now it only checks if the current web address matches any of the links, that must have an underlying reason…
There is no class
.top-bar-section in the HTML by the way, only
.top-bar. And a live link to your site could be helpful.