Skip to content
Permalink
Browse files

Accordion: fix user-defined style issue when margin is set on expander

  • Loading branch information...
Ca-Phun Ung
Ca-Phun Ung committed Sep 26, 2008
1 parent 9246c51 commit b920e5893a082d0445251c3832e1a40be73e7abf
Showing with 5 additions and 3 deletions.
  1. +5 −3 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();
}
});

0 comments on commit b920e58

Please sign in to comment.
You can’t perform that action at this time.