Skip to content

Commit b685fae

Browse files
committed
First Draft
1 parent a3165cc commit b685fae

File tree

5 files changed

+3392
-3502
lines changed

5 files changed

+3392
-3502
lines changed

dist/jquery.requestAnimationFrame.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,31 @@
44

55
(function( $ ) {
66

7+
var animating,
8+
requestAnimationFrame = window.webkitRequestAnimationFrame ||
9+
window.mozRequestAnimationFrame ||
10+
window.oRequestAnimationFrame;
11+
12+
function raf() {
13+
if ( animating ) {
14+
requestAnimationFrame( raf );
15+
jQuery.fx.tick();
16+
}
17+
}
18+
19+
if ( requestAnimationFrame ) {
20+
21+
jQuery.fx.timer = function( timer ) {
22+
if ( timer() && jQuery.timers.push( timer ) && !animating ) {
23+
animating = true;
24+
raf();
25+
}
26+
};
27+
28+
jQuery.fx.stop = function() {
29+
animating = false;
30+
};
31+
32+
}
33+
734
}( jQuery ));
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
/*! jQuery requestAnimationFrame - v0.0.0 - 2012-08-09
22
* https://github.com/gnarf37/jquery-requestAnimationFrame
33
* Copyright (c) 2012 Corey Frang; Licensed MIT */
4-
(function(a){})(jQuery);
4+
(function(a){function d(){b&&(c(d),jQuery.fx.tick())}var b,c=window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame;c&&(jQuery.fx.timer=function(a){a()&&jQuery.timers.push(a)&&!b&&(b=!0,d())},jQuery.fx.stop=function(){b=!1})})(jQuery);

0 commit comments

Comments
 (0)