Сообщение от walker1232
|
когда дошло до 5 процентов
|
Circle._animate = function (options) {
var start = Date.now(); // сохранить время начала
requestAnimationFrame(function tick() {
var timePassed = Date.now() - start;
var progress = timePassed / options.duration;
var timeFunction = options.timeFunction || function (progress) {
return progress;
};
progress = progress > 1 ? 1 : progress;
options.step(timeFunction(progress));
if(progress !== 1) {
requestAnimationFrame(tick);
}
if (progress > .05 && options.complete) {
options.complete();
options.complete = null
}
});
};