X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Ffx.js;h=711825f9941fed8d6a146bffa46927acb97f5b42;hb=084079d2fd1c7ed3582612cc32b01346b43fb415;hp=d75f3d0b0c6d15449b2d4e2870da5e609b542340;hpb=dbca9cbf629e282b511c32c8c870da37ef9fa92b;p=jquery.git diff --git a/src/fx.js b/src/fx.js index d75f3d0..711825f 100644 --- a/src/fx.js +++ b/src/fx.js @@ -66,10 +66,10 @@ jQuery.fn.extend({ }, animate: function( prop, speed, easing, callback ) { - var opt = jQuery.speed(speed, easing, callback); + var optall = jQuery.speed(speed, easing, callback); - return this[ opt.queue === false ? "each" : "queue" ](function(){ - opt = jQuery.extend({}, opt); + return this[ optall.queue === false ? "each" : "queue" ](function(){ + var opt = jQuery.extend({}, optall); var hidden = jQuery(this).is(":hidden"), self = this; for ( var p in prop ) { @@ -105,8 +105,8 @@ jQuery.fn.extend({ // We need to compute starting value if ( unit != "px" ) { - self.style[ name ] = end + unit; - start = (end / e.cur(true)) * start; + self.style[ name ] = (end || 1) + unit; + start = ((end || 1) / e.cur(true)) * start; self.style[ name ] = start + unit; } @@ -126,7 +126,7 @@ jQuery.fn.extend({ }, queue: function(type, fn){ - if ( jQuery.isFunction(type) ) { + if ( jQuery.isFunction(type) || ( type && type.constructor == Array )) { fn = type; type = "fx"; } @@ -162,6 +162,8 @@ var queue = function( elem, type, array ) { if ( !elem ) return; + type = type || "fx"; + var q = jQuery.data( elem, type + "queue" ); if ( !q || array ) @@ -201,7 +203,8 @@ jQuery.extend({ // Queueing opt.old = opt.complete; opt.complete = function(){ - jQuery(this).dequeue(); + if ( opt.queue !== false ) + jQuery(this).dequeue(); if ( jQuery.isFunction( opt.old ) ) opt.old.apply( this ); };