Ask questions and get good answers on jQuery

Is there a method to call to close an mb.menu?

I have onclick methods that run ajax to load new data into the tab below the menu and it often leaves the menu pane I just clicked open until I click somewhere on the screen?

This seems like an implementation error on my part as it only happens sometimes but I can't seem to figure it out besides it seems to happen when onclick method makes a jquery call.

Is there a function I could call to redundantly force the menu to close?

Alex

asked Jan 26 at 12:10

alexmuro's gravatar image

alexmuro
1


Hi Alex,

Did you get any javascript error in console once this happens?

By default the menu should close on click event (line 421 of the latest gitHub version); if it doesen't it means there have been something that stops the close action.

To answare your question, yes, there's a method that closes all the opened menu at once:

$(document).removeMbMenu(null,false);

But I suggest you to find out what's going on into your code.

Bye, Matteo

answered Jan 26 at 15:28

Matteo%20Bicocchi's gravatar image

Matteo Bicocchi ♦♦
1776129

edited Jan 26 at 15:45

Hey Matteo,

Thanks for the response and for building awesome jquery tools.

Currently this problem doesn't throw an error in the chrome console but now that I know what lines aren't getting run I will try to debug it further, I agree that would be the best solution.

Thanks also for the pointer to the removeMbMenu function.

Cheersm Alex

answered Jan 26 at 15:34

alexmuro's gravatar image

alexmuro
1

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×4

Asked: Jan 26 at 12:10

Seen: 89 times

Last updated: Jan 26 at 15:45

jQuery main site - Matteo Bicocchi