Hi, I was hoping someone might be able to help me out with this little countdown script. I'm trying to get it to display a countdown from two minutes rather than the default 10 seconds it is set at.
I emailed the author but the email is a dead address so I post here for help thanks.
[I think I just have to adjust these parameters but I keep breaking it.]
HTML Code:
<!-- Begin
<!--
var g_iCount = new Number();
// CHANGE THE COUNTDOWN NUMBER HERE - ADD ONE TO IT //
var g_iCount = 11;
function startCountdown(){
if((g_iCount - 1) >= 0){
g_iCount = g_iCount - 1;
numberCountdown.innerText = '00:00.0' + g_iCount;
setTimeout('startCountdown()',1000);
}
}
// End -->
</script>
Original script via javascriptsource.com:
HTML Code:
<!-- THREE STEPS TO INSTALL NUMBER COUNTDOWN:
1. Copy the coding into the HEAD of your HTML document
2. Add the onLoad event handler into the BODY tag
3. Put the last coding into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! [URL]http://javascript.internet.com[/URL] -->
<!-- Ben ([EMAIL="BassClar89@aol.com"]BassClar89@aol.com[/EMAIL]) -->
<!-- Begin
<!--
var g_iCount = new Number();
// CHANGE THE COUNTDOWN NUMBER HERE - ADD ONE TO IT //
var g_iCount = 11;
function startCountdown(){
if((g_iCount - 1) >= 0){
g_iCount = g_iCount - 1;
numberCountdown.innerText = '00:00.0' + g_iCount;
setTimeout('startCountdown()',1000);
}
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Insert the onLoad event handler into your BODY tag -->
<BODY onLoad="startCountdown()">
<!-- STEP THREE: Copy this code into the BODY of your HTML document -->
<font face="Digital Readout Upright" color="red" size="1">
<div align="center" id="numberCountdown"></div>
</font>
<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by <a href="[URL]http://javascriptsource.com">The[/URL] JavaScript Source</a></font>
</center><p>
<!-- Script Size: 1.33 KB -->
Thanks,
.naughtymonkey
Last edited by chrishirst; 05-09-2010 at 07:13 AM..
|