From 29352c26cf9b1d64188e5302d0968da4e309be21 Mon Sep 17 00:00:00 2001 From: Nathan Wong Date: Mon, 6 Sep 2010 02:37:21 +0100 Subject: [PATCH] Fix so inline-block elements animate correctly --- src/effects.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/effects.js b/src/effects.js index 40326e23da..351cec3ee3 100644 --- a/src/effects.js +++ b/src/effects.js @@ -136,6 +136,13 @@ jQuery.fn.extend({ // Make sure that nothing sneaks out opt.overflow = this.style.overflow; + + // Detect inline-block standard, pre ie8 fix, and pre Firefox 3 fix + opt.ibCheck = (jQuery.css(this,"display") === "inline-block") || + (jQuery.css(this,"zoom") !== "normal" && jQuery.css(this,"display") === "inline") || + (jQuery.css(this,"display") === "-moz-inline-stack") || + (jQuery.css(this,"display") === "none"); + } if ( jQuery.isArray( prop[p] ) ) { @@ -303,7 +310,7 @@ jQuery.fx.prototype = { (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this ); // Set display property to block for height/width animations - if ( ( this.prop === "height" || this.prop === "width" ) && this.elem.style ) { + if ( ( this.prop === "height" || this.prop === "width" ) && this.elem.style && !this.options.ibCheck) { this.elem.style.display = "block"; } },