I need help figuring out how to hide a div when empty space on the margins of the page is clicked, as opposed to just any area outside of the div. I've managed to achieve this functionality when certain other divs are clicked, but I'm stuck on implementing it for empty space clicks. Here's a simple jsfiddle you can use to experiment with.
Below is the basic jQuery code I am currently using. Is there a way to modify it so that clicking on empty space will make either "text1" or "text2" disappear?
$("#2").click(function() {
$('#text1').slideUp(300);
});
$("#1").click(function() {
$('#text2').slideUp(300);
});