just also create a transparent fullpage overlay, so when a user clicks on the page (actually the div overlay) you can do something like
$("div.overlay").click(function () { $(".classname").hide(); }); jonhobbs wrote:
HI, I'm trying to make a layer popup when you focus on a text box. That't the easy bit though and I've managed to do that. I now want the layer to disappear if the user clicks anywhere on the page EXCEPT on the layer, or the textbox they clicked into. I'm struggling to think of how to do this. I guess I could attach the click event to the page body then try to work out the co-ordinates that were clicked or something like that, but that seems a bad way to do it. Any help would really be appreciated. Jon