X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Ffx.js;h=9bfe99962a3220606587e1dd9cc5c4ec602b9556;hb=2ccd2cb36be6169afee3bd6e82ba3539f432c73f;hp=4ccb089111387147bae55f8bd40e859e52aa0196;hpb=1d299d375b6d97d65559286d914df2d5a77949db;p=jquery.git diff --git a/src/fx.js b/src/fx.js index 4ccb089..9bfe999 100644 --- a/src/fx.js +++ b/src/fx.js @@ -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 ) @@ -220,6 +222,7 @@ jQuery.extend({ }, timers: [], + timerId: null, fx: function( elem, options, prop ){ this.options = options; @@ -251,8 +254,8 @@ jQuery.fx.prototype = { if ( this.elem[this.prop] != null && this.elem.style[this.prop] == null ) return this.elem[ this.prop ]; - var r = parseFloat(jQuery.curCSS(this.elem, this.prop, force)); - return r && r > -10000 ? r : parseFloat(jQuery.css(this.elem, this.prop)) || 0; + var r = parseFloat(jQuery.css(this.elem, this.prop, force)); + return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0; }, // Start an animation from one number to another @@ -274,16 +277,18 @@ jQuery.fx.prototype = { jQuery.timers.push(t); - if ( jQuery.timers.length == 1 ) { - var timer = setInterval(function(){ + if ( jQuery.timerId == null ) { + jQuery.timerId = setInterval(function(){ var timers = jQuery.timers; for ( var i = 0; i < timers.length; i++ ) if ( !timers[i]() ) timers.splice(i--, 1); - if ( !timers.length ) - clearInterval( timer ); + if ( !timers.length ) { + clearInterval( jQuery.timerId ); + jQuery.timerId = null; + } }, 13); } },