Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detecting jquery-ui accordion open / close state

How do I conditionally handle when an accordion section is open. What I am asking is this (in pseudo code):

if (this-accordion-section-open){
   do something
}
else {
   do something else
}

I am looking for something like :isvisible.

Thanks for your help.

like image 439
Josh Scott Avatar asked Mar 03 '12 04:03

Josh Scott


People also ask

How to make accordion closed by default jQuery?

In the demoAccordion div, add 3 div which are going to be panels of the Accordion. Now, using the jQuery accordion() method, create the Accordion and keep the collapsible property as true. Set the active property to false To make the accordion collapse, by default.

What does the jQuery accordion widget do?

The Widget accordion function can be used with widgets in JqueryUI. Accordion is same like as Tabs,When user click headers to expand content that is broken into logical sections.


1 Answers

following code return you the active panel,

var active = $( ".selector" ).accordion( "option", "active" );
like image 146
Chamika Sandamal Avatar answered Nov 13 '22 05:11

Chamika Sandamal