aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2010-01-20 03:26:39 +0000
committerScott González <scott.gonzalez@gmail.com>2010-01-20 03:26:39 +0000
commitb0195091a66f0c070610a09744c4325308b24534 (patch)
tree3ce7be6a9cef133cdfb8e882ca82fff278e4c852
parent34266c3b154b870525bf91d93de809ca447ed6f4 (diff)
downloadjquery-ui-b0195091a66f0c070610a09744c4325308b24534.tar.gz
jquery-ui-b0195091a66f0c070610a09744c4325308b24534.zip
Accordion: Check for division by zero error during animation.
Fixes #4382 - Accordion does not function in IE7/WinXP.
-rw-r--r--ui/jquery.ui.accordion.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/ui/jquery.ui.accordion.js b/ui/jquery.ui.accordion.js
index cae2eef39..a6a526c88 100644
--- a/ui/jquery.ui.accordion.js
+++ b/ui/jquery.ui.accordion.js
@@ -454,7 +454,7 @@ $.extend($.ui.accordion, {
return;
}
var overflow = options.toShow.css('overflow'),
- percentDone,
+ percentDone = 0,
showProps = {},
hideProps = {},
fxAttrs = [ "height", "paddingTop", "paddingBottom" ],
@@ -480,7 +480,8 @@ $.extend($.ui.accordion, {
// IE gets very inconsistent results when animating elements
// with small values, which is common for padding
if (settings.prop == 'height') {
- percentDone = (settings.now - settings.start) / (settings.end - settings.start);
+ percentDone = ( settings.end - settings.start === 0 ) ? 0 :
+ (settings.now - settings.start) / (settings.end - settings.start);
}
options.toShow[0].style[settings.prop] =