diff options
Diffstat (limited to 'src/effects.js')
-rw-r--r-- | src/effects.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/effects.js b/src/effects.js index 223c8e549..0469eefb6 100644 --- a/src/effects.js +++ b/src/effects.js @@ -116,7 +116,7 @@ function createTween( value, prop, animation ) { function defaultPrefilter( elem, props, opts ) { /* jshint validthis: true */ - var prop, value, toggle, tween, hooks, oldfire, display, + var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay, anim = this, orig = {}, style = elem.style, @@ -160,9 +160,12 @@ function defaultPrefilter( elem, props, opts ) { // Set display property to inline-block for height/width // animations on inline elements that are having width/height animated display = jQuery.css( elem, "display" ); + // Test default display if display is currently "none" - if ( (display === "none" ? defaultDisplay( elem.nodeName ) : display) === "inline" && - jQuery.css( elem, "float" ) === "none" ) { + checkDisplay = display === "none" ? + jQuery._data( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display; + + if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) { // inline-level elements accept inline-block; // block-level elements need to be inline with layout |