Bug Tracker

Opened 11 years ago

Closed 10 years ago

Last modified 8 years ago

#4593 closed bug (invalid)

accordion getter option active always returns null

Reported by: dekiland Owned by:
Priority: major Milestone: 1.4
Component: unfiled Version: 1.3.2
Keywords: accordion option active Cc:
Blocked by: Blocking:

Description

Hi there ...

I'm trying unsuccessfully to grab the id/index of the active pane of an accordion widget. For example, using the example.html file that came with jqueryUI, I have:

$("#accordion").accordion({ header: "h3"});

<h2 class="demoHeaders">Accordion</h2> <div id="accordion">

<div>

<h3><a href="#">First</a></h3> <div>Lorem ipsum dolor sit amet. Lorem

ipsum dolor sit amet. Lorem ipsum dolor sit amet.</div>

</div> <div>

<h3><a href="#">Second</a></h3> <div>Phasellus mattis tincidunt

nibh.</div>

</div> <div>

<h3><a href="#">Third</a></h3> <div>Nam dui erat, auctor a, dignissim

quis.</div>

</div>

</div>

I then added a button which called a function in order to show me which pane was active:

$("#testAcc").click(function() {

var foo =

$('#accordion').accordion('option', 'active');

alert(foo); return false;

});

This function always reports 'null'. If I set the accordion's initial structure to have active=false, the click function always returns 'false'. I must be daft here as in the documentation they say that this pattern (('option', 'active')) is the getter for the active element, but it seems to only ever report the initial state.

Change History (1)

comment:1 Changed 10 years ago by dmethvin

Resolution: invalid
Status: newclosed

This is not a jQuery core bug. Please use the jQuery forums or contact the author via the method they request. For jQuery UI plugins, please file a bug on http://dev.jqueryui.com .

Note: See TracTickets for help on using tickets.