hd.
hd.

Reputation: 18296

How to get the active panel in jquery ui accordion

I am using jquery ui accordion plugin. How can I get the active panel in the page ?

Upvotes: 1

Views: 7812

Answers (3)

WhiteFangs
WhiteFangs

Reputation: 704

I guess the question was more how to get the active panel div, and not just the index. Use this selector:

$("#accordion .ui-accordion-content")[$("#accordion").accordion("option", "active")];

or this one:

$("#accordion .ui-accordion-content-active");

Upvotes: 5

Chan
Chan

Reputation: 34

onclick event add current index in hidden field,it's more easy to use.

Upvotes: 1

rjmcb
rjmcb

Reputation: 3745

use this selector :

 $( ".acc" ).accordion( "option", "active" );

Upvotes: 2

Related Questions