I'm displaying an iframe overlay with a z-index of 9999 with 100% width and height. The actual div inside the iframe is is only 620px wide. The problem is, I can not hide the iframe by simply click outside that div. Here's the code I'm using now
$(document).click(function() {
alert("hide iframe");
});
$(".myDivInsideMyIframe").click(function(e) {
e.stopPropagation();
return false;
});
How can I hide my iframe by click outside the div thats inside?
jsfiddle: http://jsfiddle.net/H5Vpd/7/
To make what I'm trying to do clearer:
The widget is coming from my domain and will be embedded on others. I can't control whats on other domain but I think it'd be nice if the user clicks outside the div thats in my iframe, it would hide the iframe