[ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
// opacity animations
[ "opacity" ]
- ];
+ ],
+ fxNow;
+
+function clearFxNow() {
+ fxNow = undefined;
+}
+
+function createFxNow() {
+ setTimeout( clearFxNow, 0 );
+ return ( fxNow = jQuery.now() );
+}
jQuery.fn.extend({
show: function( speed, easing, callback ) {
var self = this,
fx = jQuery.fx;
- this.startTime = jQuery.now();
+ this.startTime = fxNow || createFxNow();
this.start = from;
this.end = to;
this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" );
// Each step of an animation
step: function( gotoEnd ) {
- var t = jQuery.now(), done = true;
+ var t = fxNow || createFxNow(),
+ done = true;
if ( gotoEnd || t >= this.options.duration + this.startTime ) {
this.now = this.end;