PDA

View Full Version : Close popup when clikcing outside it?



Wobbler
12-08-2003, 04:32 PM
CanI close a popup that I've opened trough a page and when I click outside the popup close it (the popup)?

If you can, plaise explain how or give som samples

kansel
12-08-2003, 05:31 PM
In your popup window HTML include this bit of javascript
<script language="javascript" type="text/javascript">
window.onblur = function(){window.close();};
</script>That will invoke the close() function when the popup window loses focus, essentially when you click anything outside of the popup window.