diff options
author | Ca-Phun Ung <pazu2k@gmail.com> | 2008-09-26 02:31:38 +0000 |
---|---|---|
committer | Ca-Phun Ung <pazu2k@gmail.com> | 2008-09-26 02:31:38 +0000 |
commit | b920e5893a082d0445251c3832e1a40be73e7abf (patch) | |
tree | 746eb25d1fd83a394c53b730338ec7b71ba4fa72 /ui/ui.accordion.js | |
parent | 9246c5117f476a1349e5fec2ae5785f8770f17b0 (diff) | |
download | jquery-ui-b920e5893a082d0445251c3832e1a40be73e7abf.tar.gz jquery-ui-b920e5893a082d0445251c3832e1a40be73e7abf.zip |
Accordion: fix user-defined style issue when margin is set on expander
Diffstat (limited to 'ui/ui.accordion.js')
-rw-r--r-- | ui/ui.accordion.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ui/ui.accordion.js b/ui/ui.accordion.js index 45fe85b94..9f01e9c12 100644 --- a/ui/ui.accordion.js +++ b/ui/ui.accordion.js @@ -254,8 +254,10 @@ $.extend($.ui.accordion, { var hideHeight = options.toHide.height(), showHeight = options.toShow.height(), difference = showHeight / hideHeight, - padding = options.toShow.outerHeight() - options.toShow.height(); - options.toShow.css({ height: 0, overflow: 'hidden', marginBottom: -padding }).show(); + padding = options.toShow.outerHeight() - options.toShow.height(), + margin = options.toShow.css('marginBottom'), + tmargin = options.toShow.css('marginTop'); + options.toShow.css({ height: 0, overflow: 'hidden', marginTop: 0, marginBottom: -padding }).show(); options.toHide.filter(":hidden").each(options.complete).end().filter(":visible").animate({height:"hide"},{ step: function(now) { var current = (hideHeight - now) * difference; @@ -270,7 +272,7 @@ $.extend($.ui.accordion, { if ( !options.autoHeight ) { options.toShow.css("height", "auto"); } - options.toShow.css("marginBottom", 0); + options.toShow.css({marginTop: tmargin, marginBottom: margin}); options.complete(); } }); |