Code: Alles auswählen
<script>
function countdown(time){
timeleft = time;
if (timeleft < 0) {
timeleft = 0;
}
seconds = timeleft%60;
timeleft -= seconds;
timeleft = timeleft/60;
minutes = timeleft%60;
timeleft -= minutes;
timeleft = timeleft/60;
hours = timeleft%24;
timeleft -= hours;
days = timeleft/24;
var counterstring = '<strong class="Days"><em>'+days+'</em>Tag';
if (days != 1) {
counterstring = counterstring+'e';
}
counterstring = counterstring+'</strong>'
counterstring = counterstring+'<strong class="Hours"><em>'+hours+'</em>Stunde';
if (hours != 1) {
counterstring = counterstring+'n';
}
counterstring = counterstring+'</strong>'
counterstring = counterstring+'<strong class="Minutes"><em>'+minutes+'</em>Minute';
if (minutes != 1) {
counterstring = counterstring+'n';
}
counterstring = counterstring+'</strong>'
counterstring = counterstring+'<strong class="Seconds"><em>'+seconds+'</em>Sekunde';
if (seconds != 1) {
counterstring = counterstring+"n";
}
counterstring = counterstring+'</strong>'
document.getElementById("counter").innerHTML = counterstring;
newtime = time-1;
setTimeout("countdown(newtime)",1000)
}
</script>
<p id="counter" style="font-family:Arial,sans-serif; font-size:12px; color:black"><script>countdown(1778700);</script></p>
20Tage14Stunden5Minuten3Sekunden
Ich hätte nur gern ein Lehrzeichen zwischen den Blöcken quasi so:
20Tage 14Stunden 5Minuten 3Sekunden
Ich hab schon versucht diverse </ br> einzubauen, komm aber irgendwie nicht auf das erhoffte Ergebnis.
Kann mir hierbei eventuell jemand unter die Arme greifen?