PageRenderTime 72ms CodeModel.GetById 30ms app.highlight 2ms RepoModel.GetById 39ms app.codeStats 0ms

/js/lib/RequestAnimationFrame.js

http://github.com/onedayitwillmake/RealtimeMultiplayerNodeJs
JavaScript | 22 lines | 11 code | 7 blank | 4 comment | 1 complexity | a7b319f112f3dc57b9af68ae6f44ae90 MD5 | raw file
 1/**
 2 * Provides requestAnimationFrame in a cross browser way.
 3 * http://paulirish.com/2011/requestanimationframe-for-smart-animating/
 4 */
 5
 6if ( !window.requestAnimationFrame ) {
 7
 8	window.requestAnimationFrame = ( function() {
 9
10		return window.webkitRequestAnimationFrame ||
11		window.mozRequestAnimationFrame ||
12		window.oRequestAnimationFrame ||
13		window.msRequestAnimationFrame ||
14		function( /* function FrameRequestCallback */ callback, /* DOMElement Element */ element ) {
15
16			window.setTimeout( callback, 1000 / 60 );
17
18		};
19
20	} )();
21
22}