The best way to do :not in jQuery?

Posted by Smickie on Stack Overflow See other posts from Stack Overflow or by Smickie
Published on 2010-04-27T11:38:40Z Indexed on 2010/04/27 11:43 UTC
Read the original article Hit count: 265

Filed under:
|
|
|
|

Hi,

I have a menu in jQuery when you click on a link it opens up, but I want it so when you click somewhere else, anywhere else that is not the menu, it becomes hidden.

At the moment I'm binding a click event to

$(':not(#the_menu)')

But this seems like I'm binding a click event to the entire minus the menu, is there a more efficient way of doing something like this?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about select