Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Making a timer to change to another page

Status
Not open for further replies.

pielz

Programmer
Nov 12, 2002
8
US
Alright i'm trying to make a page that comes up and just appears for like 10 seconds. Just enough for the user to read like 5 words and then goes to another page. So how would i make a timer or is to get the completed? Thanks for your help people!
 
<script>
var timeLeft = 10
function startTimer(){
timeLeft --
if (timeLeft < 0) {
document.location = &quot;nextPage.htm&quot;
}
minsLeft = Math.floor(timeLeft / 60)
secsLeft = timeLeft - (minsLeft * 60)
if (secsLeft < 10){
secsLeft = &quot;0&quot; + secsLeft
}
window.status = minsLeft + &quot;:&quot; + secsLeft
timerID = setTimeout(&quot;startTimer()&quot;,1000)
}
</script>
<body onLoad=&quot;startTimer()&quot;>

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rich Cook
 
< m e t a http-equiv=&quot;Refresh&quot; Content=&quot;10; URL=http://www.yourURLhere.com/path/to/page.asp&quot;>


10 being the number of seconds you wish to use... make m e t a one word- I was just worried about it showing up
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top