-4
rated 0 times
[
0]
[
4]
/ answers: 1 / hits: 127693
/ 14 Years ago, fri, july 23, 2010, 12:00:00
$(document).click(function(evt) {
var target = evt.currentTarget;
var inside = $(.menuWraper);
if (target != inside) {
alert(bleep);
}
});
I am trying to figure out how to make it so that if a user clicks outside of a certain div (menuWraper), it triggers an event.. I realized I can just make every click fire an event, then check if the clicked currentTarget is same as the object selected from $(.menuWraper). However, this doesn't work, currentTarget is HTML object(?) and $(.menuWraper) is Object object? I am very confused.
More From » jquery