Return to Snippet

Revision: 28177
at July 3, 2010 00:03 by magicrebirth


Initial Code
// imagine the accordion is started like this:
$("#accordion").accordion({ header: 'h5', collapsible: true , active: false});


//  this gets you the index of open accordion [0.....n]
$("#accordion h5").index($("#accordion h5.ui-state-active")); 

// let's save that index.. and use it to activate/deactivate the tab
n = $("#accordion h5").index($("#accordion h5.ui-state-active"));
$('#accordion').accordion('activate', n);

Initial URL
http://jqueryui.com/demos/accordion/#method-activate

Initial Description

                                

Initial Title
JQuery Accordion: retrieve active tab / open dynamically

Initial Tags
jquery

Initial Language
JavaScript