Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Bram Huisman
7,387 PointsHide mobile menu when li is clicked - bootstrap
Hi guys, don't know if this is the correct section for this question but..
I've made a site.. almost everything is done! you can check him out over here: www.dev.bhuge.nl
But there is one problem. When you click on a menu item the hamburger dropdown doesn't goes up. I have tried many things but can't get it working properly..
Can you guys help me?
Bram Huisman
7,387 PointsNo, it's not my personal website
LaVaughn Haynes
12,397 PointsSorry. I misread your question. I understand what you mean now.
Bram Huisman
7,387 PointsCan you help me? :D
LaVaughn Haynes
12,397 PointsI'll take a look
1 Answer
LaVaughn Haynes
12,397 PointsIt's difficult to understand what's going on without seeing your exact code, but I suppose you could add a click listener to the menu items to either directly hide the menu, or trigger a click event on the nav bar which should also hide the menu.
example:
$('.navbar-nav').find('a').on('click', function(e){
$('.navbar-toggle').trigger('click');
});
Bram Huisman
7,387 PointsThx, worked perfectly
LaVaughn Haynes
12,397 PointsLaVaughn Haynes
12,397 PointsI think you posted the wrong link.