Reputation: 1455
So I have a jquery accordion based off h2s and an unordered list. Inside the list, there is a list item that has an a href with active class associated with it.
Is there way to get the jquery accordion to fire the correct panel if it has an active class?
Upvotes: 0
Views: 2429
Reputation: 6294
You will want to get the index of your active class and use the "active" option on the accordion.
function setActive() {
var index = $('#myaccordion li').index($('#myaccordion li.activeClass'));
$('#myaccordion').accordion("option","active" index);
}
For more information you can look here and here. Hope this helps.
Upvotes: 2