One Page Navigation in Mega Menu

I have a website that is more or less a one-pager. Except for the imprint and the privacy policy.

In the picture the first links above the dash are # links that go to the same page. The links below the dash are other pages.

Bildschirmfoto 2023-01-06 um 11.17.51

My problem is that the links for the one page navigation do not close the mega menu as soon as you click on it. Because the page is not left. But at smaller screen resolutions the mega menu fills the screen completely and you don’t realize that the page has already navigated there.

Is it possible to set the MegaMenu to close even with one-page navigation?

Yes creating a custom attribute data-x-toggle-close=1 on your links while also having an href will do this exact thing. More docs on this will come out.

image

Thanks for the hint, I thought I would have to tinker with JavaScript or something.

I’m just wondering if it wouldn’t make sense to set a navigation element to this functionality in general. I mean, it’s obvious that I want to navigate when I click on a navigation element. Because the Mega Menu has filled the screen, you could not see that the navigation actually works, only you thought it is something broken because obviously nothing happened.

But thanks again for the tip, my customer was already nervous because the page was already online.

Just for the record, found the related doc to this: https://theme.co/docs/toggleable

1 Like

You are most welcome, @Regnalf.

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