Код: Выделить всё
function anim1() {
// animate element 1
}
function anim2() {
// animate element 2
}
function anim3() {
// animate element 3
}
requestAnimationFrame(anim1);
requestAnimationFrame(anim2);
requestAnimationFrame(anim3);
Код: Выделить всё
(function anim() {
requestAnimationFrame(anim);
anim1();
anim2();
anim3();
}());
Подробнее здесь: https://stackoverflow.com/questions/171 ... erformance
Мобильная версия