Menu icon Foundation
Close foundation 6 top with Javascript

Hi, I am using foundation 6 Topbar, with responsive navigation from here https://foundation.zurb.com/sites/docs/responsive-navigation.html. It works great, but I want to be able to close it (using JQuery) if I click other elements on the page. 

Example: I have a button elsewhere which toggles open a price list, however, if you have already opened the Topbar menu and then click my price list button, both menus are open together. I would like to close them respectively when one is open. So I'll need a function to check if Topbar is open, and if it is, a method to close it. And I'll also need a callback method which I can run after hitting the Topbar menu toggle button with which to close any other open menus. 

Hope this makes sense. 

Essentially I just want one menu open at a time.

Any help would be much appreciated, thanks x

Simon 

topbarjavascriptresponsive navigationcallback functions

Hi, I am using foundation 6 Topbar, with responsive navigation from here https://foundation.zurb.com/sites/docs/responsive-navigation.html. It works great, but I want to be able to close it (using JQuery) if I click other elements on the page. 

Example: I have a button elsewhere which toggles open a price list, however, if you have already opened the Topbar menu and then click my price list button, both menus are open together. I would like to close them respectively when one is open. So I'll need a function to check if Topbar is open, and if it is, a method to close it. And I'll also need a callback method which I can run after hitting the Topbar menu toggle button with which to close any other open menus. 

Hope this makes sense. 

Essentially I just want one menu open at a time.

Any help would be much appreciated, thanks x

Simon