Automatically updates navigation menu state on scroll position change