File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- ( function ( ) {
1+ ( function ( ) {
22 var lastTime = 0 ;
33 var vendors = [ 'webkit' , 'moz' ] ;
4- for ( var x = 0 ; x < vendors . length && ! window . requestAnimationFrame ; ++ x ) {
5- window . requestAnimationFrame = window [ vendors [ x ] + 'RequestAnimationFrame' ] ;
6- window . cancelAnimationFrame =
7- window [ vendors [ x ] + 'CancelAnimationFrame' ] || window [ vendors [ x ] + 'CancelRequestAnimationFrame' ] ;
4+ for ( var x = 0 ; x < vendors . length && ! window . requestAnimationFrame ; ++ x ) {
5+ window . requestAnimationFrame = window [ vendors [ x ] + 'RequestAnimationFrame' ] ;
6+ window . cancelAnimationFrame = window [ vendors [ x ] + 'CancelAnimationFrame' ] ||
7+ window [ vendors [ x ] + 'CancelRequestAnimationFrame' ] ;
88 }
99
1010 if ( ! window . requestAnimationFrame ) {
11- window . requestAnimationFrame = function ( callback , element ) {
11+ window . requestAnimationFrame = function ( callback ) {
1212 var currTime = new Date ( ) . getTime ( ) ;
1313 var timeToCall = Math . max ( 0 , 16 - ( currTime - lastTime ) ) ;
14- var id = window . setTimeout ( function ( ) { callback ( currTime + timeToCall ) ; } ,
14+ var id = window . setTimeout ( function ( ) {
15+ callback ( currTime + timeToCall ) ;
16+ } ,
1517 timeToCall ) ;
1618 lastTime = currTime + timeToCall ;
1719 return id ;
1820 } ;
1921 }
2022
2123 if ( ! window . cancelAnimationFrame ) {
22- window . cancelAnimationFrame = function ( id ) {
24+ window . cancelAnimationFrame = function ( id ) {
2325 clearTimeout ( id ) ;
2426 } ;
2527 }
You can’t perform that action at this time.
0 commit comments