if click is not on div do something code example
Example: click outside box jquery
$(document).click(function(){
$("#try").hide();
});
$("#try").click(function(e){
e.stopPropagation();
});
$(document).click(function(){
$("#try").hide();
});
$("#try").click(function(e){
e.stopPropagation();
});