Ticket #4392 (closed bug: fixed)
Accordion: option animated true causes JavaScript error
| Reported by: | rdworth | Owned by: | scott.gonzalez |
|---|---|---|---|
| Priority: | critical | Milestone: | 1.8 |
| Component: | ui.accordion | Version: | 1.7.1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
The accordion option 'animated' is documented as supporting boolean data type. animated: false works, but animated: true does not.
Expected animated: true enables animation with 'slide' (the documented default animation)
Actual animated: true causes a JavaScript error when a header is clicked.
jQuery.easing[this.options.easing || (jQuery.easing.swing ? "swing" : "linear")] is not a function file:jquery-1.3.2.js Line 4139
Change History
comment:2 Changed 4 years ago by epascarello
Looking into the error
this.options.easing is equal to a Boolean value of true when jQuery.easing[] is looking for a value of linear or swing.
Getting the exisiting code to run
If we change the example that rdworth posted to
$("#accordion").accordion({
animated: "swing"
});
or
$("#accordion").accordion({
animated: "linear"
});
it runs fine.
Possible Solution
If we still want to use a Boolean value the code around line 329-331 of ui.accordian.js [1.7.1] needs to be adjusted to something like this:
var animations = $.ui.accordion.animations, duration = o.duration, easing = (typeof o.animated === "boolean")?"linear":o.animated;
| "swing" | true |
comment:3 Changed 4 years ago by epascarello
This bug here: http://dev.jqueryui.com/ticket/4394 might be the real cause of this issue.


Visual test: http://jquery-ui.googlecode.com/svn/trunk/tests/visual/accordion/accordion_option_animated_true.html