Skip to main content

Search and Top Navigation

#4392 closed bug (fixed)

Opened March 23, 2009 11:35AM UTC

Closed April 17, 2009 11:05PM UTC

Accordion: option animated true causes JavaScript error

Reported by: rdworth Owned by: scottgonzalez
Priority: critical Milestone: 1.8
Component: ui.accordion Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:
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
Attachments (0)
Change History (5)

Changed March 25, 2009 04:01AM UTC by epascarello comment:2

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;

with this change animated can have the following values: "linear" || "swing" || true

Changed March 25, 2009 04:40AM UTC by epascarello comment:3

This bug here: http://dev.jqueryui.com/ticket/4394 might be the real cause of this issue.

Changed April 17, 2009 10:34PM UTC by scottgonzalez comment:4

owner: → scott.gonzalez
status: newassigned

Changed April 17, 2009 11:05PM UTC by scottgonzalez comment:5

resolution: → fixed
status: assignedclosed

Fixed in r2471.