View Full Version : Close popup when clikcing outside it?

Dec 8th, 2003, 05: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

Dec 8th, 2003, 06: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.