Hello ?
I have a countdown script, who should count down to “March 1, 2006”.
Can anobody make this little script working?
I will be so happy ?
Here you can see the script:
<title>Timer Countdown In Page</title>
<!– –><SCRIPT>
<!–
// Browser Compatible for this script: IE 2.0 or Higher
// Netscape 2.0 or Higher
var theDay = new Date(“March 1, 2006”) //Date must be in the form Month Day, Year
var DayTill //The string that is going to put all numbers together and make sense.
function countdown()
{
var today = new Date() //Create a variable with today’s date
var second = Math.floor((theDay.getTime() – today.getTime())/1000) //Find the seconds
var minute = Math.floor(second/60) //Devide “second” into 60 to get the minutes
var hour = Math.floor(minute/60) //Devide “minute” into 60 to get the hours
var day = Math.floor(hour/24) //Devide “hour” into 60 to get the days
CDay= day //Correct day
CHour= hour % 24 //Correct hour, after devide into 24, the remainder deposits here.
CMinute= minute % 60 //Correct minute, after devide into 60, the remainder deposits here.
CSecond= second % 60 //Correct second, after devide into 60, the remainder deposits here.
if (CDay < 0 ) {CDay = “0”; CHour = “0”; CMinute = “0”; CSecond = “0”;} //Stop at 0
DayTill = CDay + ” Dager, ” + CHour + ” Timer, ” + CMinute + ” Minutter og ” + CSecond + ” Sekunder “
//Rewrite the string to the correct information.
document.clock.countdown.value = DayTill //Make the particular form chart become “Daytill”
var counter = setTimeout(“countdown()”, 1000)
}
//–>
</SCRIPT>
</head>
<body bgcolor=”#000000″>
<!– –><BODY onLoad = “countdown()” bgcolor=”#000000″> <! You must have countdown() here to run the script –>
<p align=”center”>
<FORM NAME = “clock”>
<p align=”center”>
<font face=”Verdana” style=”font-size: 10pt” color=”#FFFF00″>Det er </font>
<span style=”font-size: 3pt”>
<font face=”Verdana” color=”#FFFFFF”>
<INPUT NAME= “countdown” SIZE= “42” style=”border:1px solid #000000; padding:0px; font-family:Verdana; font-size:10pt; color:#FFFF00; background-color:#000000″></font><font face=”Verdana” color=”#FFFF00″> </font></span>
<font face=”Verdana” color=”#FFFF00″><span style=”font-size: 10pt”>til Påmeldingen
åpner!</span></font></FORM><font color=”#FFFF00″><!– –>
</font>
<p> </p>
</body>
</html>