Hallo
folegendes Script startet nach 10sek.
var pixel = 48;
function startAnimation() {
starte = window.setInterval("animation()", 20);
}
function animation() {
var elem = document.getElementById("ani").style;
elem.height = pixel + "px";
pixel = pixel + 1;
if ( pixel == 232 ) {
clearInterval(starte);
}
}
window.onload = function() { neu = window.setTimeout("startAnimation()", 10000) };
Nun will ich dem User auch die Möglichkeit geben früher die Animation zu starten. Ich habe das eingestezt.
<a href="" onclick="startAnimation()">Klick</a>
Leider funktioniert das nicht ganz so. Es springt nur ein Stk. nach oben und geht wieder in die Ausgangsposition.
Was mache ich da falsch
lG