Skip to content
This repository has been archived by the owner. It is now read-only.
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Working with RequestAnimationFrame

A port of the example used in the Leaner, Meaner, Faster Animations with requestAnimationFrame article by Paul Lewis, originally published on HTML5Rocks.

The article explains how to correctly use requestAnimationFrame for your animations. Here is a summary of the article contents:

  • Decouple your events from animations
  • Avoid animations that result in reflow-repaint loops
  • Update your RAF calls to expect a high resolution timestamp as the first parameter
  • Only call RAF when you have visual updates to do

Use the up and down keys to activate the animation. The up key moves the circles from right to left, and the down key moves them from left to right.

Please report any bugs or feature requests.

You can’t perform that action at this time.