I'm using the following code to animate a block. In my code, div_animate()
essentially hides a <div>
with the specified selector if it is currently visible.
$(document).click(function(event){
div_animate("#container");
});
I need to determine whether the user clicked on a child of #container
and if so, return false;
-- as far as I can tell, the code for this would look something like this:
$(document).click(function(event){
if ( /* the event's target has a parent of #container */ ) {
return false;
} else {
div_animate("#container");
}
});
Any thoughts?