As you guys can see, I have a drop down menu.
I have a lot of columns, each one has an option to open the menu.
$(\".optionCont\").live(\"click\", fu
Try something like:
$(document).click(function(e) {
if ($(e.target) != myEl)
myEl.slideUp();
})
Alternative: working example.
Source:
$(".optionCont").live("click", function(e) {
var that = this;
$(document).click(function(e) {
console.log(e.target);
console.log(that);
if (e.target != that) {
e.stopPropagation();
e.preventDefault();
$(".dropMenuCont").slideUp();
}
});
if ($(this).next().css("display") === "none") {
$(this).next().slideDown();
} else {
$(this).next().slideUp();
}
e.stopPropagation();
e.preventDefault();
});