Skip to content

Commit 4b017b4

Browse files
committed
Accordion: Handle box-sizing: border-box in animations
Fixes #9264 Closes jquerygh-1287 Closes jquerygh-1459
1 parent c077e0a commit 4b017b4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ui/accordion.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,7 @@ return $.widget( "ui.accordion", {
524524
var total, easing, duration,
525525
that = this,
526526
adjust = 0,
527+
boxSizing = toShow.css( "box-sizing" ),
527528
down = toShow.length &&
528529
( !toHide.length || ( toShow.index() < toHide.index() ) ),
529530
animate = this.options.animate || {},
@@ -566,7 +567,9 @@ return $.widget( "ui.accordion", {
566567
step: function( now, fx ) {
567568
fx.now = Math.round( now );
568569
if ( fx.prop !== "height" ) {
569-
adjust += fx.now;
570+
if ( boxSizing === "content-box" ) {
571+
adjust += fx.now;
572+
}
570573
} else if ( that.options.heightStyle !== "content" ) {
571574
fx.now = Math.round( total - toHide.outerHeight() - adjust );
572575
adjust = 0;

0 commit comments

Comments
 (0)