]> source.dussan.org Git - jquery.git/commitdiff
Merge branch '8101_lrbabe_requestAnimationFrame' of https://github.com/timmywil/jquer...
authorjeresig <jeresig@gmail.com>
Sun, 10 Apr 2011 21:27:34 +0000 (17:27 -0400)
committerjeresig <jeresig@gmail.com>
Sun, 10 Apr 2011 21:27:34 +0000 (17:27 -0400)
Conflicts:
src/effects.js

1  2 
src/effects.js

diff --cc src/effects.js
index ad2ed3c97587510bf87ad3d72d8fa200bc89a98c,976fe765b4a0b01317809f86ad62a4c756cd92a8..f334ac95b3a5746d9daf8890eea86158178f49e7
@@@ -12,17 -12,10 +12,20 @@@ var elemdisplay = {}
                // opacity animations
                [ "opacity" ]
        ],
-       fxNow;
++      fxNow,
+       requestAnimationFrame = window.webkitRequestAnimationFrame ||
+           window.mozRequestAnimationFrame ||
+           window.oRequestAnimationFrame;
  
 +function clearFxNow() {
 +      fxNow = undefined;
 +}
 +
 +function createFxNow() {
 +      setTimeout( clearFxNow, 0 );
 +      return ( fxNow = jQuery.now() );
 +}
 +
  jQuery.fn.extend({
        show: function( speed, easing, callback ) {
                var elem, display;
@@@ -357,9 -350,10 +360,10 @@@ 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.startTime = fxNow || createFxNow();
                this.start = from;
                this.end = to;
                this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" );