Ich habe eine Animation mit requesetAnimationFrame Und wenn ich es wiederhole, wird es schneller und schneller, bis es unsichtbar wird.JavaScript: requestAnimateFrame werde schneller
function tirer(){
var missile=document.getElementById("missile");
var currt= missile.currentStyle ||window.getComputedStyle(missile);
if (parseInt(currt.bottom)<700)
missile.style.bottom=parseInt(missile.style.bottom)+20+"px";
else
alert ("in top");
}
function animation(){
tirer();
requestAnimationFrame(animation);
}
Wie kann ich eine stabile, konstante Geschwindigkeit bekommen?
Mögliches Duplikat von [Steuern von fps mit requestAnimationFrame?] (Http://stackoverflow.com/questions/19764018/controlling-fps-with-requestanimationframe) – Li357
Ja, das gilt! Danke ! – unfoudev