Just wondering if there was a way to add a close button into the nav menu for mobile devices. By default the menu covers the hanburger icon and it’s not easy to close. I’d like to put an X in the menu to close it. Also, if I put a margin in to offset the menu, the hamburger button doesn’t close the menu either. Any advice?
Hi @DFink
Adding a close button is a piece of cake actually!
Just add a link block without an actual link (default link is: #). Clicking whatever link inside a navbar will always close the foldout menu. So a link block without an actual link is perfect for a close-button.
It doesn’t seem to work. I enclosed it in a script tag as you mentioned in that other thread. Is that correct? I replaced menu-button with my class for the menu button.
Rowan, that is a really nice template. How did you get the menu to fill the whole frame?
What I actually would love to have is exactly what rowan has with an X in the menu itself but for it to not take me to the top of the page. Any way to do that?
Simple novice question. If I already have a script in my code section, can I add this between those script tags or should I create a new script open and close?
I followed your instructions and copied your code from the video but I used a text block for the trigger instead to get an x for the close button. It doesn’t work for some reason. Can you take a look at my public link?
This worked perfectly for me, thank you! No issues with it scrolling all the way to the top because my menu is only at the top anyway. Thanks for posting this!