Hamburger (Nav Toggle Menu)

@wolfganghofer posted this:
When I click on a menu item on the iPhone, the navigation panel does not close automatically. I have to click on the hamburger icon again to do this. This is a bit inconvenient.

Can anyone tell me how to solve the problem?

1 Like

Hi @Grandpa

You could solve this by adding a couple of custom attributes to the menu items. This issue is happening because you are using scroll too.

You need 2 attributes per menu item thats scrolling on the same page. I got the navbar class from your site, so it should work fine.

data-toggle="collapse"

and

data-target=".navbar-41601"

Screen Shot 2021-10-07 at 12.15.07 PM

3 Likes

By the way, if you update your site to Bootstrap 5 these attribute names change slightly to…

data-bs-toggle="collapse"

and

data-bs-target=".navbar-41601"

Maybe we can ask @Norm to include this in the Scroll to option so it automatically collapses the navigation.

The only thing, is you dont always use it just in the navbar.

2 Likes

Hi @Malachiman, yes yes yes … I think, everything is fine. Thanks a lot. :smiley:

I’m soo happy.

1 Like