thebrain
01.01.2008, 22:30
hallo kann sich jemand mal den script ansehen ?
das ist ein countdown welche die tage bis silvester 2008 runterzählt.
hab das jahr auf 2009 geändert, aber es erscheint nicht das es 365 tage sein müssten
weis jemand wo der fehler liegt ?
<tr>
<td class="alt2" width="100%">
<script language="JavaScript">
function countdown() {
d=new Date();
count=Math.floor((eventdate.getTime()-d.getTime())/1000);
if(count<=0)
{
document.all.days.innerHTML="-";
document.all.hours.innerHTML="-";
document.all.mins.innerHTML="-";
document.all.secs.innerHTML="-";
return;
}
document.getElementById('secs').innerHTML=count%60;
count=Math.floor(count/60);
document.getElementById('mins').innerHTML=count%60;
count=Math.floor(count/60);
document.getElementById('hours').innerHTML=count%24;
count=Math.floor(count/24);
document.getElementById('days').innerHTML=count%365;
count=Math.floor(count/365);
setTimeout("countdown()",500);
}
</script>
<script language="JavaScript">
var eventdate = new Date("Januar 01,2009 00:00:00");
</script>
<table border="0" cellspacing="0" cellpadding="0" width="100%" align="center">
<tr>
<td align="center"><strong>Tage</strong></td>
<td align="center"><strong>Stunden</strong></td>
<td align="center"><strong>Minuten</strong></td>
<td align="center"><strong>Sekunden</strong></td>
</tr>
<tr>
<td align="center"><strong><font color="red"><div id="days"></div></font></strong></td>
<td align="center"><strong><font color="red"><div id="hours"></div></font></strong></td>
<td align="center"><strong><font color="red"><div id="mins"></div></font></strong></td>
<td align="center"><strong><font color="red"><div id="secs"></div></font></strong></td>
</tr>
</table>
<script language="JavaScript">
countdown()
</script>
das ist ein countdown welche die tage bis silvester 2008 runterzählt.
hab das jahr auf 2009 geändert, aber es erscheint nicht das es 365 tage sein müssten
weis jemand wo der fehler liegt ?
<tr>
<td class="alt2" width="100%">
<script language="JavaScript">
function countdown() {
d=new Date();
count=Math.floor((eventdate.getTime()-d.getTime())/1000);
if(count<=0)
{
document.all.days.innerHTML="-";
document.all.hours.innerHTML="-";
document.all.mins.innerHTML="-";
document.all.secs.innerHTML="-";
return;
}
document.getElementById('secs').innerHTML=count%60;
count=Math.floor(count/60);
document.getElementById('mins').innerHTML=count%60;
count=Math.floor(count/60);
document.getElementById('hours').innerHTML=count%24;
count=Math.floor(count/24);
document.getElementById('days').innerHTML=count%365;
count=Math.floor(count/365);
setTimeout("countdown()",500);
}
</script>
<script language="JavaScript">
var eventdate = new Date("Januar 01,2009 00:00:00");
</script>
<table border="0" cellspacing="0" cellpadding="0" width="100%" align="center">
<tr>
<td align="center"><strong>Tage</strong></td>
<td align="center"><strong>Stunden</strong></td>
<td align="center"><strong>Minuten</strong></td>
<td align="center"><strong>Sekunden</strong></td>
</tr>
<tr>
<td align="center"><strong><font color="red"><div id="days"></div></font></strong></td>
<td align="center"><strong><font color="red"><div id="hours"></div></font></strong></td>
<td align="center"><strong><font color="red"><div id="mins"></div></font></strong></td>
<td align="center"><strong><font color="red"><div id="secs"></div></font></strong></td>
</tr>
</table>
<script language="JavaScript">
countdown()
</script>