From: jeresig Date: Sun, 10 Apr 2011 21:27:34 +0000 (-0400) Subject: Merge branch '8101_lrbabe_requestAnimationFrame' of https://github.com/timmywil/jquer... X-Git-Tag: 1.6b1~26 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=56ffad2dad138293c132e6ad353111bd2d1f1239;p=jquery.git Merge branch '8101_lrbabe_requestAnimationFrame' of https://github.com/timmywil/jquery into timmywil-8101_lrbabe_requestAnimationFrame Conflicts: src/effects.js --- 56ffad2dad138293c132e6ad353111bd2d1f1239 diff --cc src/effects.js index ad2ed3c97,976fe765b..f334ac95b --- a/src/effects.js +++ b/src/effects.js @@@ -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" );