diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2009-01-31 16:52:52 +0000 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2009-01-31 16:52:52 +0000 |
commit | bae4a16d61e6c19e4d30b7a7511ae1858a639d44 (patch) | |
tree | 8083f384083a68bca2c73403aa84535a8ab5346a | |
parent | 658a0f7f4097da160ef7117ad7e8c48494a242e3 (diff) | |
download | jquery-ui-bae4a16d61e6c19e4d30b7a7511ae1858a639d44.tar.gz jquery-ui-bae4a16d61e6c19e4d30b7a7511ae1858a639d44.zip |
accordion: another partial fix for #4011, fixes tests/visual/accordion/width.html in FF, IE still buggy
-rw-r--r-- | ui/ui.accordion.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/ui/ui.accordion.js b/ui/ui.accordion.js index 6ce36ec45..62f038a1a 100644 --- a/ui/ui.accordion.js +++ b/ui/ui.accordion.js @@ -398,7 +398,14 @@ $.extend($.ui.accordion, { percentDone, showProps = {}, hideProps = {}, - fxAttrs = [ "height", "paddingTop", "paddingBottom" ]; + fxAttrs = [ "height", "paddingTop", "paddingBottom" ], + originalWidth; + // fix width before calculating height of hidden element + if (options.toShow[0]) { + var s = options.toShow; + originalWidth = s[0].style.width; + s.width( parseInt(s.parent().width()) - parseInt(s.css("paddingLeft")) - parseInt(s.css("paddingRight")) - parseInt(s.css("borderLeftWidth")) - parseInt(s.css("borderRightWidth")) ); + } $.each(fxAttrs, function(i, prop) { hideProps[prop] = 'hide'; @@ -431,8 +438,9 @@ $.extend($.ui.accordion, { easing: options.easing, complete: function() { if ( !options.autoHeight ) { - options.toShow.css("height", "auto"); + options.toShow.css("height", ""); } + options.toShow.css("width", originalWidth); options.toShow.css({overflow: overflow}); options.complete(); } |