Currently, I have a one-page website that serves as a portfolio. The website features a menu at the top with links that direct visitors to specific sections of the page using # as links.
I am looking to enhance the user experience by implementing a functionality where, if the visitor is at the top of the site (the home section), the "home" link will change its CSS class to a.menuActive, thereby changing the color of the menu button. This change should occur either when the link is clicked or simply when the user scrolls to that particular section. To achieve this, I believe I will need a script that can detect the user's position on the page. How can I go about implementing this feature?