mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-06-06 16:38:55 +00:00
33 lines
835 B
JavaScript
33 lines
835 B
JavaScript
var rfa = null;
|
|
if (window.requestAnimationFrame) {
|
|
rfa = requestAnimationFrame;
|
|
} else if (window.mozRequestAnimationFrame) {
|
|
rfa = mozRequestAnimationFrame;
|
|
} else if (window.webkitRequestAnimationFrame) {
|
|
rfa = webkitRequestAnimationFrame;
|
|
} else if (window.msRequestAnimationFrame) {
|
|
rfa = msRequestAnimationFrame;
|
|
} else if (window.oRequestAnimationFrame) {
|
|
rfa = oRequestAnimationFrame;
|
|
}
|
|
|
|
function animate(params, count) {
|
|
rfa(function() {
|
|
animateStep(params, count);
|
|
});
|
|
}
|
|
|
|
function animateStep(params, count) {
|
|
if (!count) {
|
|
document.documentElement.removeAttribute("class");
|
|
return;
|
|
}
|
|
var rel = document.getElementById("rel");
|
|
for (prop in params) {
|
|
rel.style[prop] = (parseInt(rel.style[prop]) + params[prop]) + "px";
|
|
}
|
|
rfa(function() {
|
|
animateStep(params, count - 10);
|
|
});
|
|
}
|