+ 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

9th Oct 2017, 5:29 PM
CHANDOLU SUDHEER KUMAR
CHANDOLU SUDHEER KUMAR - avatar
1 Odpowiedź
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.
15th Nov 2017, 9:59 AM
J-D-X