mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Accordion: Check for division by zero error during animation.
Fixes #4382 - Accordion does not function in IE7/WinXP.
This commit is contained in:
parent
34266c3b15
commit
b0195091a6
5
ui/jquery.ui.accordion.js
vendored
5
ui/jquery.ui.accordion.js
vendored
@ -454,7 +454,7 @@ $.extend($.ui.accordion, {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var overflow = options.toShow.css('overflow'),
|
var overflow = options.toShow.css('overflow'),
|
||||||
percentDone,
|
percentDone = 0,
|
||||||
showProps = {},
|
showProps = {},
|
||||||
hideProps = {},
|
hideProps = {},
|
||||||
fxAttrs = [ "height", "paddingTop", "paddingBottom" ],
|
fxAttrs = [ "height", "paddingTop", "paddingBottom" ],
|
||||||
@ -480,7 +480,8 @@ $.extend($.ui.accordion, {
|
|||||||
// IE gets very inconsistent results when animating elements
|
// IE gets very inconsistent results when animating elements
|
||||||
// with small values, which is common for padding
|
// with small values, which is common for padding
|
||||||
if (settings.prop == 'height') {
|
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] =
|
options.toShow[0].style[settings.prop] =
|
||||||
|
Loading…
Reference in New Issue
Block a user