Below is the code that I want to execute a command if the click is not on the rl_menu / any of it's child elements (.comment, .rl_arrow, etc)
TBR.mouse_down = function(e){
target = $j(this)
if (target != $j("#rl_menu") && target != $j("#rl_menu .comment") &&
target != $j("#rl_menu .change") && target != $j("#rl_menu .rl_arrow_border") &&
target != $j("#rl_menu .rl_arrow")){
TBR.Menu.hide(); // this needs to be triggered when the menu is not clicked on.
}
}
but when I inspect target, target is the document.
To recap:
Anywhere in the document, when the mouse is pressed, TBR.Menu.hide()
should be executed. but if the click is within #rl_menu
, TBR.Menu.hide()
shouldn't be executed.
Am I going about this the wrong way?