function animate(id, delta) {
element = document.getElementById(id);
from = 0;
to = 1;
duration = 100;
start = new Date().getTime();
setTimeout(function() {
var now = (new Date().getTime()) - start;
var progress = now / duration;
var result = (to - from)*delta(progress)+from;
element.style.backgroundPosition = "-"+result+"mm 0mm";
//element.innerHTML = result;
setTimeout(arguments.callee, 1);
}, 10);
}
убрал лишнее