|
|
Reply
| 0 recommendations | Message 1 of 9 in Discussion |
| (Original Message) | Sent: 1/26/2004 5:33 AM |
This message has been deleted by the manager or assistant manager. |
|
First
Previous
2-9 of 9
Next
Last
|
Reply
| 0 recommendations | Message 3 of 9 in Discussion |
|
This message has been deleted by the manager or assistant manager. |
|
Reply
| 0 recommendations | Message 4 of 9 in Discussion |
|
This message has been deleted by the manager or assistant manager. |
|
Reply
| |
<script type="text/javascript"> <!-- function getTime() { var textArea = self.document.getElementById( "countdownTextArea" );
if ( textArea == null ) { alert( "Text Area Not Found!!!" ); return; }
currenttime = new Date();
//The next line is the target countdown value //It is based on LOCAL TIME to the countdown value targettime = new Date( "January 1 2005 00:00:00" );
dcdays = ( targettime - currenttime ) / 1000 / 60 / 60 / 24; dcdaysRound = Math.floor( dcdays ); dchours = ( targettime - currenttime ) / 1000 / 60 / 60 - ( 24 * dcdaysRound ); dchoursRound = Math.floor( dchours ); dcminutes = ( targettime - currenttime ) / 1000 / 60 - ( 24 * 60 * dcdaysRound ) - ( 60 * dchoursRound ); dcminutesRound = Math.floor( dcminutes ); dcseconds = ( targettime - currenttime ) / 1000 - ( 24 * 60 * 60 * dcdaysRound ) - ( 60 * 60 * dchoursRound ) - ( 60 * dcminutesRound ); dcsecondsRound = Math.round( dcseconds );
// This formats the countdown text. You can change this to do it any way you like. textArea.innerHTML = fillText( dcdaysRound, 2, "0" ) + checkPlural( " Day", dcdaysRound ) + ", " + fillText( dchoursRound, 2, "0" ) + checkPlural( " Hour", dchoursRound ) + ", " + fillText( dcminutesRound, 2, "0", dcminutesRound ) + checkPlural( " Minute", dcminutesRound ) + "<BR>and " + fillText( dcsecondsRound, 2, "0" ) + checkPlural( " second", dcsecondsRound ); if ( currenttime >= targettime ) { // This is the message when the target datetime is hit. Make sure the countdown string format matches // The one above. textArea.innerHTML = "00 Days, 00 Minutes, 00 Hours<BR>and 00 Seconds<BR><BR><B>Happy New Year!!</B>"; return; }
newtime = window.setTimeout( "getTime();", 1000 ); }
function checkPlural( noun, value ) { noun = ( value == 1 ) ? noun : noun + "s"; return ( noun ); }
function fillText( text, length, fillChar ) { // If someone knows an esier way to do this // please post it. This seems like an awful // lot of work to left fill a string. It // *DOES* work though <grin> var counter = 0; var localFillChar = fillChar.toString(); var tempText = text.toString();
while ( tempText.length < length ) { tempText = localFillChar.toString() + tempText.toString(); if ( counter < length ) { break; } }
return ( tempText ); }
//--> </script>
<DIV ALIGN="center" STYLE="font-size: x-small;"> <B>The magic happens in ....</B><BR> </DIV> <DIV ID="countdownTextArea" ALIGN="center" STYLE="font-size: xx-small;"> </DIV> <script type="text/javascript"> <!-- self.document.onLoad = getTime(); //--> </script>
|
|
Reply
| |
Very Useful Tool Geeko ... Site countter on Post#6 ... even !! |
|
First
Previous
2-9 of 9
Next
Last
|
|
|