Skip to content

Commit b019509

Browse files
committed
Accordion: Check for division by zero error during animation.
Fixes #4382 - Accordion does not function in IE7/WinXP.
1 parent 34266c3 commit b019509

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ui/jquery.ui.accordion.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ $.extend($.ui.accordion, {
454454
return;
455455
}
456456
var overflow = options.toShow.css('overflow'),
457-
percentDone,
457+
percentDone = 0,
458458
showProps = {},
459459
hideProps = {},
460460
fxAttrs = [ "height", "paddingTop", "paddingBottom" ],
@@ -480,7 +480,8 @@ $.extend($.ui.accordion, {
480480
// IE gets very inconsistent results when animating elements
481481
// with small values, which is common for padding
482482
if (settings.prop == 'height') {
483-
percentDone = (settings.now - settings.start) / (settings.end - settings.start);
483+
percentDone = ( settings.end - settings.start === 0 ) ? 0 :
484+
(settings.now - settings.start) / (settings.end - settings.start);
484485
}
485486

486487
options.toShow[0].style[settings.prop] =

0 commit comments

Comments
 (0)