Skip to content
Permalink
Browse files

Separate raf function definition from passing it to requestAnimationF…

…rame
  • Loading branch information...
timmywil
timmywil committed Apr 10, 2011
1 parent 9db18dd commit 791402b4536b8c5cbfeaf27d0a3c639cdb9fd192
Showing with 6 additions and 4 deletions.
  1. +5 −3 src/effects.js
  2. +1 −1 src/sizzle
@@ -350,7 +350,8 @@ jQuery.fx.prototype = {
// Start an animation from one number to another
custom: function( from, to, unit ) {
var self = this,
fx = jQuery.fx;
fx = jQuery.fx,
raf;

this.startTime = jQuery.now();
this.start = from;
@@ -369,13 +370,14 @@ jQuery.fx.prototype = {
// Use requestAnimationFrame instead of setInterval if available
if ( requestAnimationFrame ) {
timerId = 1;
requestAnimationFrame(function raf() {
raf = function() {
// When timerId gets set to null at any point, this stops
if ( timerId ) {
requestAnimationFrame( raf );
fx.tick();
}
});
};
requestAnimationFrame( raf );
} else {
timerId = setInterval( fx.tick, fx.interval );
}
Submodule sizzle updated 1 files
+1 −1 README

0 comments on commit 791402b

Please sign in to comment.
You can’t perform that action at this time.