hi,
I want to execute a function on an event on any element but one:
$(":not('#myelement')").bind('mousedown', function() {
console.log('mousedown event');
});
but when I click #myelement, the function is executed anyway, because the selector select all the parents. Moreover, the function is executed for every parent. How can I: -execute the function only once? -not execute the function on my element?
Here's the full issue:
$("#current_page a").toggle(
function(){
$("#current_menu").hide();
return false;
},
function(){
$("#current_menu").show();
return false;
}
);
$(":not(#current_page a)").bind('mousedown',function() {
$("#current_menu").hide();
});
When clicking on "#current_page a", the mousedown event is triggered, and I don't want to.
thanks jul