I’m using jQuery UI and I want to check if accordion is already applied to some element. In this case I will refresh it, else I will apply it. I want something like this
if (already_applied) {
$('#element').accordion('refresh');
}
else {
$('#element').accordion(
{
header: '> div > h3',
collapsible: true,
active: true,
autoHeight: false
}
);
};
This should work: