liveBook · Manning

requestAnimationFrame

requestAnimationFrame is a browser API method that schedules a callback to run before the next visual rendering update.

How 3 Manning books explain it

HTML5 in Action

requestAnimationFrame is a browser API method that schedules a callback before the next repaint.

How it is used
Schedules drawing callbacks for a Canvas game animation loop.
How deep it goes
Explains frame-rate fluctuations and two approaches to consistent movement, while deferring construction of a delta.
Examples
Uses a Canvas game engine and an x += 1 * delta movement update.
What you can do after
Apply requestAnimationFrame to Canvas animation and account for fluctuating frame rates in movement logic.

Read how HTML5 in Action explains requestAnimationFrame →

Web Components in Action

requestAnimationFrame is a browser API that schedules a callback to run before the next screen repaint.

How it is used
Coordinates animation or graphics updates with the browser’s render cycle.
How deep it goes
Explains one-shot callbacks, explicit rescheduling, visual updates, and an inheritable per-frame component pattern.
Examples
Uses a green visual countdown timer that shrinks each frame and resets after reaching zero.
What you can do after
Apply it via a recurring callback loop to animate a custom element on each browser frame.

Read how Web Components in Action explains requestAnimationFrame →

Math for Web Design

requestAnimationFrame is a browser API method that schedules a callback to run before the next repaint.

How it is used
Uses requestAnimationFrame() for time-based animations, circular motion, and throttled scroll-driven visual effects.
How deep it goes
Explains repeated callback scheduling within animation loops, but does not detail browser rendering internals.
Examples
Demonstrates circular motion and geometric parallax scrolling through JavaScript listings.
What you can do after
Build it from scratch for circular motion or throttle scroll-based parallax updates with JavaScript and CSS transforms.

Read how Math for Web Design explains requestAnimationFrame →

Also covered in

What to know first

Related concepts

Questions about requestAnimationFrame

What is requestAnimationFrame?

requestAnimationFrame is a browser API method that schedules a callback to run before the next visual rendering update.

Which Manning books explain requestAnimationFrame?

HTML5 in Action, Web Components in Action and Math for Web Design.

What should I know before learning requestAnimationFrame?

Manning books that teach requestAnimationFrame usually introduce coordinate and CSS first.

What is the difference between requestAnimationFrame and setInterval?

requestAnimationFrame is a browser API method that schedules a callback to run before the next visual rendering update. setInterval is a JavaScript timer function that repeatedly schedules a callback to run after a specified interval until canceled.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.