Hi,
ich habe einen Countdown geschrieben, aber ich habe einen Problem, ich habe den Code für die Header Datei:
Code:
<script type="text/javascript">
<!--
var countdown = <?=$dauer?>;;
function doCount()
{
if (countdown > 0)
{
countdown--;
document.forms['counter'].elements['counter'].value = formatTime(countdown) + ' Weiter';
window.setTimeout('doCount()', 1000);
}
else
{
document.forms['counter'].elements['counter'].value = 'Zur nächsten Seite';
document.forms['counter'].elements['counter'].disabled = false;
}
}
function formatTime(time)
{
var h = Math.floor(time / 3600);
var m = Math.floor(time % 3600 / 60);
var s = time - (h*3600 + m*60);
s = ( (s < 10) ? '0' : '' ) + s;
h = ( (h < 10) ? '0' : '' ) + h;
m = ( (m < 10) ? '0' : '' ) + m;
return h + ':' + m + ':' + s;
}
//-->
</script>
und ich habe einen Button wo es angezeigt werden soll. Aber ich habe das Probelm, ich weiß jetzt nicht was ich bei Value hinschreiben muss, damit die Zeit auch angezeigt wird:
Code:
<input type="button" name="counter" value="" onClick="document.location.href='index.php';" disabled>
Könnt ihr mir helfen