Skip to content
Permalink
Browse files

Accordion: fixed jump in accordion when expander div has padding.

  • Loading branch information...
Ca-Phun Ung
Ca-Phun Ung committed Sep 25, 2008
1 parent b5ce43a commit a23a88a0ca513b2c04d41c43008d522ffcd34a7c
Showing with 4 additions and 2 deletions.
  1. +4 −2 ui/ui.accordion.js
@@ -253,8 +253,9 @@ $.extend($.ui.accordion, {
}
var hideHeight = options.toHide.height(),
showHeight = options.toShow.height(),
difference = showHeight / hideHeight;
options.toShow.css({ height: 0, overflow: 'hidden' }).show();
difference = showHeight / hideHeight,
padding = options.toShow.outerHeight() - options.toShow.height();
options.toShow.css({ height: 0, overflow: 'hidden', marginBottom: -padding }).show();
options.toHide.filter(":hidden").each(options.complete).end().filter(":visible").animate({height:"hide"},{
step: function(now) {
var current = (hideHeight - now) * difference;
@@ -269,6 +270,7 @@ $.extend($.ui.accordion, {
if ( !options.autoHeight ) {
options.toShow.css("height", "auto");
}
options.toShow.css("marginBottom", 0);
options.complete();
}
});

0 comments on commit a23a88a

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