{Jahr 2000 Countdown}
Verbleibende Tage bis 2000:
Dieses JavaScript zählt die verbleibenden Tage bis zum Jahr 2000
Quelltext :
<script language="JavaScript"> var Temp2; var timerID = null; var timerRunning = false; function showtime() { now = new Date(); var CurHour = now.getHours(); var CurMinute = now.getMinutes(); var CurMonth = now.getMonth(); var CurDate = now.getDate(); var CurYear = now.getYear(); var CurSecond = now.getSeconds(); now = null; Hourleft = 23 - CurHour Minuteleft = 59 - CurMinute Secondleft = 59 - CurSecond var Yearleft = 99 - CurYear var Monthleft = 11 - CurMonth var Dateleft = 31 - CurDate if (Yearleft!=1) {var ys="e"} else {var ys=""}; if (Monthleft!=1) {var mos="e"} else {var mos=""} if (Dateleft!=1) {var ds="e"} else {var ds=""} if (Hourleft!=1) {var hs="n"} else {var hs=""} if (Minuteleft!=1) {var mis="n"} else {var mis=""} if (Secondleft!=1) {var ss="n"} else {var ss=""} Temp3=Yearleft+' Jahr'+ys+', '+Monthleft+' Monat'+mos+', '+Dateleft+' Tag'+ds+', '+Hourleft+' Stunde'+hs+', '+Minuteleft+' Minute'+mis+', '+Secondleft+' Sekunde'+ss document.frm.left.value=Temp3; timerID = setTimeout("showtime()",1000); timerRunning = true; } var timerID = null; var timerRunning = false; function stopclock () { if(timerRunning) clearTimeout(timerID); timerRunning = false; } function startclock () { stopclock(); showtime();} </script>
Fügen Sie in den <BODY>-Tag onload="startclock()" ein.