requestAnimationFrame

suggest change

Syntax

The webkit and moz prefixes are historical. Current browsers provide the unprefixed function. It is a browser API. The callback receives a DOMHighResTimeStamp, and background tabs pause these callbacks.

Parameters

Remarks

requestAnimationFrame schedules work before the next repaint. It does not by itself animate an element, and a CSS transition does not require it.

Animating transform and opacity can stay off the main-thread layout path. Animating layout properties such as top or width forces layout. Neither choice is a guarantee of a smooth frame rate.

References URL
What is jank? http://jankfree.org/
High Performance Animations http://www.html5rocks.com/en/tutorials/speed/high-performance-animations/
R.A.I.L. https://developers.google.com/web/tools/chrome-devtools/profile/evaluate-performance/rail?hl=en
Analyzing Critical Rendering Path https://developers.google.com/web/fundamentals/performance/critical-rendering-path/analyzing-crp?hl=en
Rendering Performance https://developers.google.com/web/fundamentals/performance/rendering/?hl=en
Analyzing Paint Times https://developers.google.com/web/updates/2013/02/Profiling-Long-Paint-Times-with-DevTools-Continuous-Painting-Mode?hl=en
Identifying Paint Bottlenecks https://developers.google.com/web/fundamentals/performance/rendering/simplify-paint-complexity-and-reduce-paint-areas?hl=en

Use requestAnimationFrame to fade in element

Cancelling an animation

Keeping compatibility

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents