I've written the attached script to autoclose a popup window if the window has not retained focus for a specified period of time (10s) using the setTimeout() method. If the user comes back to the window, ie:The window regains focus, the popup remains open by applying the clearTimeout() method. The countdown to closure starts over if the user leaves the popup again. The code is attached as a text file. It is a full HTML page and includes my troubleshooting form boxes.
The difficulty I'm having is this:
Netscape: The countdown will not start the first time you leave the popup. If you renter the popup, it then works fine. Also, it does not recognize keyboard focus if you click on the chrome, addressbar, etc. Only if you click inside the document. This appears true for 4.xx and 6.xx. I haven't tried 7.x
IE6.x: The timer times down if you leave the popup. It also stops if you renter the popup and you've clicked on the body of the document, exactly as it should. However, if the popup window includes other html elements such as a form field, table, image, link, etc., and you reenter by clicking on one of those elements instead of document 'white space', the timer clears, but immediately restarts. Also, if you just click on another element within the document, the timer starts unless you click somewhere within the document to stop it. This is a huge problem if the document is essentially one large table. It seems to me the window regains focus for a moment, but the html element the takes focus from the window, thus the window blurs and the counter restarts to close the window.
I've looked through all of my sources and several websites to try to handle the IE problem. (I can live with the NS problem if I have to). But I can't seem to get anything to work properly.
Any suggestions.
russ marcks
PS: The text file I've enclosed is intended to be opened in a popup window with no decorations.
The difficulty I'm having is this:
Netscape: The countdown will not start the first time you leave the popup. If you renter the popup, it then works fine. Also, it does not recognize keyboard focus if you click on the chrome, addressbar, etc. Only if you click inside the document. This appears true for 4.xx and 6.xx. I haven't tried 7.x
IE6.x: The timer times down if you leave the popup. It also stops if you renter the popup and you've clicked on the body of the document, exactly as it should. However, if the popup window includes other html elements such as a form field, table, image, link, etc., and you reenter by clicking on one of those elements instead of document 'white space', the timer clears, but immediately restarts. Also, if you just click on another element within the document, the timer starts unless you click somewhere within the document to stop it. This is a huge problem if the document is essentially one large table. It seems to me the window regains focus for a moment, but the html element the takes focus from the window, thus the window blurs and the counter restarts to close the window.
I've looked through all of my sources and several websites to try to handle the IE problem. (I can live with the NS problem if I have to). But I can't seem to get anything to work properly.
Any suggestions.
russ marcks
PS: The text file I've enclosed is intended to be opened in a popup window with no decorations.