Skip to content

Commit 17a6f74

Browse files
author
Matthew Doyle
committed
Add timeout to ensure animation completes
1 parent e25d1c6 commit 17a6f74

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

js/jquery.accordion.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,12 @@
195195

196196
// Reset max height and set height to auto to allow dynamic
197197
// content sizing until the next accordion interaction
198+
// Use setTimeout to ensure animation has had a chance to finish
199+
setTimeout(function () {
200+
$content.css('max-height', 'none');
201+
}, opts.transitionSpeed);
202+
198203
$content.css('height', 'auto');
199-
$content.css('max-height', 'none');
200204
});
201205

202206
$accordion.addClass('open');

0 commit comments

Comments
 (0)