All menu-items get initialized as 'current-menu-item'

Hello guys,
all menu items/links here on desktop get initialized as ‘current-menu-item’ and change only when scrolling beyond the nav-bar and current items depend on the scroll positions. That causes the links to look all like 'current-menu-item’s up to that point.

I’ve read this thread https://theme.co/apex/forum/t/one-page-navigation-all-the-menu-items-are-highlighted-on-load/46761/2 but it suggests to add another navigation in order to work around this bug. I’d really like my menu to work from all pages, e.g. separate pages from the footer like terms & conditions, which require to have the url before the anchor url/#anchor. Would you mind fixing that bug and adding that last tiny bit of logic please ?

Bringing that in order you wouldn’t need this highly confusing option anymore either, you could simply autodetect anchor links for my 5 cents. All this option seems to do is working around the mentioned bug, but unfortunately only for non-url anchors, so I guess you could as well just enhance this function instead of rewriting it generically which should be your first choice.

Hi Hei,

The One Page Navigation was originally intended for landing page navigation and that could not be easily changed for backwards compatibility for the sites using it.

The feature also provided the ability to choose a unique menu and enable the smooth scrolling jump links function in the past. Now, it’s only used for menu selection because smooth scroll is not implemented Globally.

The only thing that needs enhancement now is the domain detection (e.g. example.com/#section). This does not happen in sub-directories (e.g. example.com/page/#section). I’ll post this in our issue tracker. For now, the suggested method should be used.

Thanks.

1 Like

Understood. Thanks for that!

You’re welcome.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.