Split the queue code out from data.js into a dedicated queue.js file (also split...
[jquery.git] / src / fx.js
index d3a7ad4..529fd4c 100644 (file)
--- a/src/fx.js
+++ b/src/fx.js
@@ -219,7 +219,7 @@ jQuery.each({
 jQuery.extend({
 
        speed: function(speed, easing, fn) {
-               var opt = typeof speed === "object" ? speed : {
+               var opt = speed && typeof speed === "object" ? speed : {
                        complete: fn || !fn && easing ||
                                jQuery.isFunction( speed ) && speed,
                        duration: speed,
@@ -359,7 +359,9 @@ jQuery.fx.prototype = {
                                        this.elem.style.overflow = this.options.overflow;
 
                                        // Reset the display
-                                       this.elem.style.display = this.options.display;
+                                       var old = jQuery.data(this.elem, "olddisplay");
+                                       this.elem.style.display = old ? old : this.options.display;
+
                                        if ( jQuery.css(this.elem, "display") == "none" ) {
                                                this.elem.style.display = "block";
                                        }
@@ -432,7 +434,7 @@ jQuery.extend( jQuery.fx, {
 
                _default: function(fx){
                        if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
-                               fx.elem.style[ fx.prop ] = fx.now + fx.unit;
+                               fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit;
                        } else {
                                fx.elem[ fx.prop ] = fx.now;
                        }