|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Help: Looking for javascript countdown script
Hi everyone, I am looking for a countdown script using javascript. If you have one, please let me know!
|
|
#2
|
||||
|
||||
|
Re: Help: Looking for javascript countdown script
This is a simple function that i use on our website.
PHP Code:
PHP Code:
|
|
#3
|
||||
|
||||
|
Re: Help: Looking for javascript countdown script
also Dynamic Drive has tins of cool javascript samples. here is one that does a countdown. http://www.dynamicdrive.com/dynamici...lcountdown.htm
/forest |
|
#4
|
|||
|
|||
|
Re: Help: Looking for javascript countdown script
Any of the above scripts are acceptable. Here's ours:
Code:
dateFuture = new Date(2007,2,28,24,0,0); // Set the date
function GetCount(){
dateNow = new Date(); //grab current date
amount = dateFuture.getTime() - dateNow.getTime(); //calc milliseconds between dates
delete dateNow;
// time is already past
if(amount < 0){
document.getElementById('countbox').innerHTML="Now!";
}
// date is still good
else{
days=0;hours=0;mins=0;secs=0;out="";
amount = Math.floor(amount/1000);//kill the "milliseconds" so just secs
days=Math.floor(amount/86400);//days
amount=amount%86400;
hours=Math.floor(amount/3600);//hours
amount=amount%3600;
mins=Math.floor(amount/60);//minutes
amount=amount%60;
secs=Math.floor(amount);//seconds
if(days != 0){out += days +" day"+((days!=1)?"s":"")+", ";}
if(days != 0 || hours != 0){out += hours +" hour"+((hours!=1)?"s":"")+", ";}
if(days != 0 || hours != 0 || mins != 0){out += mins +" minute"+((mins!=1)?"s":"")+", ";}
out += secs +" seconds";
document.getElementById('countbox').innerHTML=out + " until we attend the Palmetto Regional in SC!";
setTimeout("GetCount()", 1000);
}
}
window.onload=function(){
GetCount();
}
Note: Its set currently to the Palmetto Regional, change the date to whatever you want ![]() |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| looking for help on chairman award | grandmother cul | Chairman's Award | 19 | 15-02-2008 09:27 |
| Looking for help | sfshilo | General Forum | 3 | 10-04-2006 18:30 |
| Looking for help at UCF regionals | Mike Norton | Programming | 2 | 26-02-2004 12:59 |
| Looking for SECURE login script | plutonium83 | Website Design/Showcase | 9 | 22-01-2004 14:40 |
| Pit News - Looking for Help | Nate Smith | General Forum | 0 | 13-03-2003 14:09 |