|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I have a window pop-up system that a user can browse different options, and when they click on an Item it will open up in a bigger window. What I would like to do is set a timer in the window so that if a client doesn't do anything for 10 seconds the pop-up automatically disapear.
is there a way to do it using a Meta refresh command? I'm not trying to do anything complicated... Basically all it is: "If page open 10 seconds, then close popup" - the code would be in the pop-up window, preferably... thanks for your help, Dave |
|
#2
|
|||
|
|||
|
Well, I'm not sure about doing this through straight meta tags because you would want the page to stay up if you capture an event. With javascript, however, it's not that difficult. Note: I am simply a javascript dabbler, and the following code may not be the most efficient way of doing it, and I really doubt it's cross-browser. Oh well.. it gives an idea.
<script language='javascript'> var t; function doLoad() { t = setTimeout("window.close()",10000); } function clockStop() { clearTimeout(t); } </script> <body onLoad='doLoad()' onClick='clockStop()'> And that seems to work. URL Brendan Cassida http://www.witheredpipedream.com <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by dave981: I have a window pop-up system that a user can browse different options, and when they click on an Item it will open up in a bigger window. What I would like to do is set a timer in the window so that if a client doesn't do anything for 10 seconds the pop-up automatically disapear. is there a way to do it using a Meta refresh command? I'm not trying to do anything complicated... Basically all it is: "If page open 10 seconds, then close popup" - the code would be in the pop-up window, preferably... thanks for your help, Dave[/quote] |
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > Pop-up Window - Timed Auto Close |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|