tags:

views:

20

answers:

4

Hi All,

How do I add exceptions to the document?

For example within DIV(.rtmenu) I want to exclude links with the class (a.menu-arrow). So if I click/mousedown on (a.menu-arrow)...the DIV(.rtmenu) doesn't fadeOut?

$('.rtmenu').live('click', function(e) { e.stopImmediatePropagation(); });
$(document).mousedown(function() { $('.rtmenu').fadeOut(200); });


Any help is greatly appreciated. Thanks

A: 

You can use jQuery's not() function.

$('.rtmenu').not('.a-menu-arrow').live('click', function(e) { e.stopImmediatePropagation(); });
yc
A: 

You could try the .not() function:

$('.rtmenu').not('a.menu-arrow').live(...
Darin Dimitrov
A: 

http://api.jquery.com/not-selector/ You'll need to use :not

Angelo R.
+1  A: 

You can add a stop propgation to the menu links as well, like this:

$('.rtmenu').live('click', function(e) { e.stopImmediatePropagation(); });
$('.a-menu-arrow').live('mousedown', function(e) { e.stopImmediatePropagation(); });
$(document).mousedown(function() { $('.rtmenu').fadeOut(200); });
Nick Craver
@Nick - Much Appreciated, Thanks a trillion $$$$$
Nasir