# Javascript: Close after window loses focus

**URL:** <https://forum.kirupa.com/t/javascript-close-after-window-loses-focus/150119>\
**Category:** web dev\
**Created:** [June 3, 2005, 11:55pm UTC](https://forum.kirupa.com/t/javascript-close-after-window-loses-focus/150119 "2005-06-03T23:55:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![camargo](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/camargo/32/1363_2.png) [@camargo](https://forum.kirupa.com/u/camargo)\
**Post date:** [June 3, 2005, 11:55pm UTC](https://forum.kirupa.com/t/javascript-close-after-window-loses-focus/150119/1 "2005-06-03T23:55:53Z")

</div>

Hey all,

I need to have a popup window close after it loses focus. How can I accomplish that? Here’s the example:

[color=#003366][http://www.wirelessinteractive.com/24\_ant\_indoor.php](http://www.wirelessinteractive.com/24_ant_indoor.php)[/color]  
[color=#003366][/color]  
[color=#003366]Click on the “Consider the Total Solution” button and observe the popup. I need that popup to close itself if someone follows the link inside of it. Any ideas?[/color]  
[color=#003366][/color]  
[color=#003366]Thanks in advance![/color]  
[color=#003366]Kirupa forums ROCK![/color]
