Ticket #4392 (closed bug: fixed)

Opened 6 years ago

Last modified 6 years ago

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 6 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;
with this change animated can have the following values: "linear"
"swing" true

comment:3 Changed 6 years ago by epascarello

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

comment:4 Changed 6 years ago by scott.gonzalez

  • Owner set to scott.gonzalez
  • Status changed from new to assigned

comment:5 Changed 6 years ago by scott.gonzalez

  • Status changed from assigned to closed
  • Resolution set to fixed

Fixed in r2471.

Note: See TracTickets for help on using tickets.