How does double requestAnimationFrame work?

前端 未结 2 1600

While watching Google IO17, I learnt about the double requestAnimationFrame method but i can\'t really wrap my head around it maybe because i hardly involve myself in animat

2条回答
  •  萌比男神i
    2021-01-01 08:34

    Because of the bug introduced in Chrome and some others, we have to use double requestAnimationFrame whenever we find ourselves toggling classes or performing other CSS animations that requires RAF to fire after an action is performed. It's kinda like an escape hatch to have nice/smooth animation.

提交回复
热议问题