alvaro-prieto
9/27/2019 - 8:21 AM

requestanimationframe request animation

//para poder ejecutar un código en el siguiente fotograma, es más limpio y controlable que un setTimeout
if ( !window.requestAnimationFrame ) {
	window.requestAnimationFrame = ( function() {
		return 	window.webkitRequestAnimationFrame 	||
				window.mozRequestAnimationFrame 	||
				window.oRequestAnimationFrame 		||
				window.msRequestAnimationFrame 		||
				function( callback,  element ) {
					window.setTimeout( callback, 1000 / 60 );
				};
	} )();
	
}