Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Old 05-09-2010, 04:04 AM javascript countdown
thundermonkey's Avatar
Junior Talker

Posts: 1
Name: no
Trades: 0
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..
thundermonkey is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-09-2010, 07:20 AM Re: javascript countdown
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
change the 10,000 to 2*60*1000

javascript timings are defined in milliseconds, so 10 seconds = 10*1000
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to javascript countdown
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.70525 seconds with 12 queries