+ 2
How to close the other navigation menu when one of hamburger button clicks if any navigation menu opens.
Can we close the existing opened navigation menu by javascript.......? This is my first code URL :- https://code.sololearn.com/W9Q4F4roUInU/?ref=app
1 Answer
0
You can hide all navigations and exclude the one which was clicked:
$('.navbar').click(function() {
var navID = $(this).attr.('id');
$('.navbar').hide().not(navID);
});
You may have also to check if the click is a click to open or to close the navigations.