I'm trying to hide a div both when 1) certain other divs are clicked, and when 2) empty space on the margins of the page are clicked, space not contained by any div. I've got the first part covered, but I do not know how to do the second. I don't want the div to hide when ANYTHING outside the div is clicked. Just when empty space is clicked.
Here's a simple jsfiddle to play with.
And here's the basic jsquery I'm using. Can I add something that will make "text1" or "text2" disappear when the user clicks empty space?
$("#2").click(function() {
$('#text1').slideUp(300);
});
$("#1").click(function() {
$('#text2').slideUp(300);
});