|
[CODE] Countdown Timer; WANT WANT WANT
|
|
Topic Started: Apr 9 2003, 07:26 AM (4,368 Views)
|
|
Rojo
|
Apr 9 2003, 07:26 AM
Post #1
|
- Posts:
- 12
- Group:
- Members
- Member
- #989
- Joined:
- April 2, 2003
|
Does anyone have some code that would create a countdown timer, so i could have one on my board somewhere?
Sorry about the topic title, must have missed a letter out by accident.
Thanks in advance.
|
|
|
| |
|
lightsup55
|
Apr 9 2003, 11:03 AM
Post #2
|
- Posts:
- 6,502
- Group:
- Members
- Member
- #399
- Joined:
- January 19, 2003
- I'm Browsing With
- Firefox 3
- My Board URL
- http://spyforum.spyw.com/
|
Could this be what you want?
http://www.jc2k.com/J_Swatch2.html
|
|
|
| |
|
Stephen
|
Apr 9 2003, 03:29 PM
Post #3
|
Mine! Or I will help you not.
- Posts:
- 13,128
- Group:
- Community Admin
- Member
- #1,011
- Joined:
- April 3, 2003
- I'm Browsing With
- Firefox 3
- My Board URL
- http://forums.yodaminch.com
|
Try this:
- Code:
-
<br><script language="javascript" type="text/javascript"><!--var date = new Date(ENTER DATE);var now = new Date();var diff = date.getTime() - now.getTime();var days = Math.floor(diff / (1000 * 60 * 60 * 24));document.write("<b>" + (days + 1) + " ENTER TEXT HERE</b>" );//--></script><br>
OR
- Code:
-
<br> <script language="javascript" type="text/javascript"> <!-- var date = new Date('ENTER DATE'); var now = new Date(); var diff = date.getTime() - now.getTime(); var days = Math.floor(diff / (1000 * 60 * 60 * 24)); document.write("<b><font color="white">" + (days + 1) + " ENTER TEXT</b></font>" ); //--> </script> <br>
Also if you need to center it:
- Code:
-
<center>code here </center>
I hope this helps
|
|
|
| |
|
nunshukti
|
Apr 9 2003, 03:33 PM
Post #4
|
- Posts:
- 78
- Group:
- Members
- Member
- #1,017
- Joined:
- April 4, 2003
|
I think this is about what he wants: http://javascript.internet.com/clocks/digi...-countdown.html
|
|
|
| |
|
Rojo
|
Apr 9 2003, 08:30 PM
Post #5
|
- Posts:
- 12
- Group:
- Members
- Member
- #989
- Joined:
- April 2, 2003
|
I couldn't get any of this too work. What I want is a timer counting down to the release of Return of the King.
|
|
|
| |
|
Aliasgirl47
|
Apr 10 2003, 04:41 PM
Post #6
|
- Posts:
- 258
- Group:
- Members
- Member
- #1,046
- Joined:
- April 6, 2003
|
i got the one at javascript.internet to show up and then it said that i had to download the image files to use it. i did that, but how do i get the files from mycomputer to the site?
|
|
|
| |
|
Aliasgirl47
|
Apr 10 2003, 07:18 PM
Post #7
|
- Posts:
- 258
- Group:
- Members
- Member
- #1,046
- Joined:
- April 6, 2003
|
ideas anyone???
|
|
|
| |
|
Stephen
|
Apr 14 2003, 06:25 PM
Post #8
|
Mine! Or I will help you not.
- Posts:
- 13,128
- Group:
- Community Admin
- Member
- #1,011
- Joined:
- April 3, 2003
- I'm Browsing With
- Firefox 3
- My Board URL
- http://forums.yodaminch.com
|
i had a feeling it wouldn't work. I can't get mine to show either. Mine counts down to star wars episode 3.
|
|
|
| |
|
nunshukti
|
Apr 14 2003, 07:45 PM
Post #9
|
- Posts:
- 78
- Group:
- Members
- Member
- #1,017
- Joined:
- April 4, 2003
|
You have to download and upload the images for it to work. I suggest uploading them to Speedis (although it has been slow lately).
Then, change the script to the location of the images.
|
|
|
| |
|
Elessar2
|
May 5 2003, 11:59 AM
Post #10
|
- Posts:
- 172
- Group:
- Members
- Member
- #1,403
- Joined:
- April 30, 2003
|
i'm looking for the same thing. i want a countdown to the Return of the King.
i have the counter on my board, just don't know how to make it work!
i know you have to download the number files and host them but is there any other countdown that we don't have to do this? just like plain html?
please help!
|
|
|
| |
|
jedi_master_ousley
|
May 13 2003, 07:04 PM
Post #11
|
- Posts:
- 54
- Group:
- Members
- Member
- #943
- Joined:
- March 28, 2003
|
Anyone know of any that are really easy?
|
|
|
| |
|
Lady Alustriel
|
May 14 2003, 01:06 PM
Post #12
|
- Posts:
- 620
- Group:
- Members
- Member
- #234
- Joined:
- December 20, 2002
|
- Code:
-
<br><center> <script language="JavaScript"> // This Script And Over 400 Others Found At // Java City 2000 http://www.jc2k.com <!-- Activate Cloaking
/* Javascript Countdown Timer (version 1.0) Copyright (C) 1997 Gary Cohen All Rights Reserved. Permission given to use this script provided that this copyright notice remains in tact. [E-mail: gcohen@raleigh.ibm.com]
*/
var timerID; var timerRunning = false; var today = new Date(); var count = new Date(); var secPerDay = 0; var minPerDay = 0; var hourPerDay = 0; var secsLeft = 0; var secsRound = 0; var secsRemain = 0; var minLeft = 0; var minRound = 0; var dayRemain = 0; var minRemain = 0; var Expire = 0; var timeRemain = 0; var timeUp = "Christmas" // enter text to be displayed when countdown is finished var time = "0 days, 0 hours, 0 minutes, 0 seconds" //do not modify this text
function stopclock (){ if(timerRunning) clearTimeout(timerID); timerRunning = false; }
function startclock () { stopclock(); showtime(); }
function showtime () { today = new Date(); count = new Date("December 25, 1998 03:00"); // enter date to count down to ("December 25, 1998 03:00") count.setYear(today.getYear()); secsPerDay = 1000; minPerDay = 60 * 1000; hoursPerDay = 60 * 60 * 1000; PerDay = 24 * 60 * 60 * 1000; Expire = (count.getTime() - today.getTime())
/*Seconds*/
secsLeft = (count.getTime() - today.getTime()) / minPerDay;
secsRound = Math.round(secsLeft);
secsRemain = secsLeft - secsRound;
secsRemain = (secsRemain < 0) ? secsRemain = 60 - ((secsRound - secsLeft) * 60) : secsRemain = (secsLeft - secsRound) * 60;
secsRemain = Math.round(secsRemain);
/*Minutes*/
minLeft = ((count.getTime() - today.getTime()) / hoursPerDay);
minRound = Math.round(minLeft);
minRemain = minLeft - minRound;
minRemain = (minRemain < 0) ? minRemain = 60 - ((minRound - minLeft) * 60) : minRemain = ((minLeft - minRound) * 60);
minRemain = Math.round(minRemain - 0.495);
/*Hours*/
hoursLeft = ((count.getTime() - today.getTime()) / PerDay);
hoursRound = Math.round(hoursLeft);
hoursRemain = hoursLeft - hoursRound;
hoursRemain = (hoursRemain < 0) ? hoursRemain = 24 - ((hoursRound - hoursLeft) * 24) : hoursRemain = ((hoursLeft - hoursRound) * 24);
hoursRemain = Math.round(hoursRemain - 0.5);
/*Days*/
daysLeft = ((count.getTime() - today.getTime()) / PerDay);
daysLeft = (daysLeft);
daysRound = Math.round(daysLeft);
daysRemain = daysRound;
/*Fixes*/
if (daysRemain == 1) daysRemain = daysRemain + " day, "; else daysRemain = daysRemain + " days, ";
if (hoursRemain == 1) hoursRemain = hoursRemain + " hour, "; else hoursRemain = hoursRemain + " hours, ";
if (minRemain == 1) minRemain = minRemain + " minute, "; else minRemain = minRemain + " minutes, ";
if (secsRemain == 1) secsRemain = secsRemain + " second"; else secsRemain = secsRemain + " seconds";
/*Time*/
timeRemain = daysRemain + hoursRemain + minRemain + secsRemain;
window.status = ""; document.clock.face.value = timeRemain; timerID = setTimeout("showtime()",1000); timerRunning = true;
if (Expire <= 0){ document.clock.face.value = time; // choose either "time" or "timeUp" (without quotes) stopclock() }
} // De-activate Cloaking --> // --> </SCRIPT> </HEAD> <BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#FF0000" VLINK="#000080" ALINK="#000080"> <FORM NAME="clock"><INPUT TYPE="text" SIZE="41" NAME="face"></FORM>
<script language="JavaScript"> // This Script And Over 400 Others Found At // Java City 2000 http://www.jc2k.com <!-- //document.write('<FORM NAME="clock"><INPUT TYPE="text" SIZE="41" NAME="face"></FORM>'); startclock() // --> </SCRIPT> </center><br>
Put that whereever you want the counter to appear and add in the proper date to count down from and whatever text you want in there. It's plain, but it works. 
look through the code for the // marks... those indicate areas where you need to change or add something.
|
|
|
| |
|
Elessar2
|
May 29 2003, 11:41 PM
Post #13
|
- Posts:
- 172
- Group:
- Members
- Member
- #1,403
- Joined:
- April 30, 2003
|
i had mine, then it got deleted for some reason on memorial day
quibiz, you helped me the first time, can you help me again?
http://invisionfree.com/forums/the_white_rider
|
|
|
| |
|
Tidal Wave 4Him
|
Jun 1 2003, 03:03 AM
Post #14
|
- Posts:
- 53
- Group:
- Members
- Member
- #1,003
- Joined:
- April 3, 2003
|
it's not counting down, you have to refresh it just to get it to count down. i want it to countdown automatically...
|
|
|
| |
|
George Jin
|
Jun 1 2003, 11:31 AM
Post #15
|
- Posts:
- 1,260
- Group:
- Members
- Member
- #1,807
- Joined:
- May 23, 2003
|
- Lady Alustriel
- May 14, 01:06 PM
- Code:
-
<br><center> <script language="JavaScript"> // This Script And Over 400 Others Found At // Java City 2000 http://www.jc2k.com <!-- Activate Cloaking
/* Javascript Countdown Timer (version 1.0) Copyright (C) 1997 Gary Cohen All Rights Reserved. Permission given to use this script provided that this copyright notice remains in tact. [E-mail: gcohen@raleigh.ibm.com]
*/
var timerID; var timerRunning = false; var today = new Date(); var count = new Date(); var secPerDay = 0; var minPerDay = 0; var hourPerDay = 0; var secsLeft = 0; var secsRound = 0; var secsRemain = 0; var minLeft = 0; var minRound = 0; var dayRemain = 0; var minRemain = 0; var Expire = 0; var timeRemain = 0; var timeUp = "Christmas" // enter text to be displayed when countdown is finished var time = "0 days, 0 hours, 0 minutes, 0 seconds" //do not modify this text
function stopclock (){ if(timerRunning) clearTimeout(timerID); timerRunning = false; }
function startclock () { stopclock(); showtime(); }
function showtime () { today = new Date(); count = new Date("December 25, 1998 03:00"); // enter date to count down to ("December 25, 1998 03:00") count.setYear(today.getYear()); secsPerDay = 1000; minPerDay = 60 * 1000; hoursPerDay = 60 * 60 * 1000; PerDay = 24 * 60 * 60 * 1000; Expire = (count.getTime() - today.getTime())
/*Seconds*/
secsLeft = (count.getTime() - today.getTime()) / minPerDay;
secsRound = Math.round(secsLeft);
secsRemain = secsLeft - secsRound;
secsRemain = (secsRemain < 0) ? secsRemain = 60 - ((secsRound - secsLeft) * 60) : secsRemain = (secsLeft - secsRound) * 60;
secsRemain = Math.round(secsRemain);
/*Minutes*/
minLeft = ((count.getTime() - today.getTime()) / hoursPerDay);
minRound = Math.round(minLeft);
minRemain = minLeft - minRound;
minRemain = (minRemain < 0) ? minRemain = 60 - ((minRound - minLeft) * 60) : minRemain = ((minLeft - minRound) * 60);
minRemain = Math.round(minRemain - 0.495);
/*Hours*/
hoursLeft = ((count.getTime() - today.getTime()) / PerDay);
hoursRound = Math.round(hoursLeft);
hoursRemain = hoursLeft - hoursRound;
hoursRemain = (hoursRemain < 0) ? hoursRemain = 24 - ((hoursRound - hoursLeft) * 24) : hoursRemain = ((hoursLeft - hoursRound) * 24);
hoursRemain = Math.round(hoursRemain - 0.5);
/*Days*/
daysLeft = ((count.getTime() - today.getTime()) / PerDay);
daysLeft = (daysLeft);
daysRound = Math.round(daysLeft);
daysRemain = daysRound;
/*Fixes*/
if (daysRemain == 1) daysRemain = daysRemain + " day, "; else daysRemain = daysRemain + " days, ";
if (hoursRemain == 1) hoursRemain = hoursRemain + " hour, "; else hoursRemain = hoursRemain + " hours, ";
if (minRemain == 1) minRemain = minRemain + " minute, "; else minRemain = minRemain + " minutes, ";
if (secsRemain == 1) secsRemain = secsRemain + " second"; else secsRemain = secsRemain + " seconds";
/*Time*/
timeRemain = daysRemain + hoursRemain + minRemain + secsRemain;
window.status = ""; document.clock.face.value = timeRemain; timerID = setTimeout("showtime()",1000); timerRunning = true;
if (Expire <= 0){ document.clock.face.value = time; // choose either "time" or "timeUp" (without quotes) stopclock() }
} // De-activate Cloaking --> // --> </SCRIPT> </HEAD> <BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#FF0000" VLINK="#000080" ALINK="#000080"> <FORM NAME="clock"><INPUT TYPE="text" SIZE="41" NAME="face"></FORM>
<script language="JavaScript"> // This Script And Over 400 Others Found At // Java City 2000 http://www.jc2k.com <!-- //document.write('<FORM NAME="clock"><INPUT TYPE="text" SIZE="41" NAME="face"></FORM>'); startclock() // --> </SCRIPT> </center><br>
Put that whereever you want the counter to appear and add in the proper date to count down from and whatever text you want in there. It's plain, but it works.  look through the code for the // marks... those indicate areas where you need to change or add something.
With a little bit of editing, this code worked perfectly for me! Thanks.
|
|
|
| |
| 1 user reading this topic (1 Guest and 0 Anonymous)
|