I'm working on a page where a user can click on ajaxified links inside a JQuery-Accordion-Widget.

Currently every time a link is clicked and the response is loaded, the accordion gets closed and it is not possible to click it anymore - but no JS-error is raised.

Did i miss something i have to call i.e. to change the focus ?

Thanks for your help, piezo.

  • Just init the Accordion again on the ajax success. – niksmac Jan 27 '13 at 2:59
  • This seems kind of hacky to me and i would like to not change the state of the accordion before the ajax-call.. – Piezo Pea Jan 27 '13 at 12:13

You can probably use one of the jQuery Accordion API functions to manually control the state of the accordion


// getter
var active = $( ".selector" ).accordion( "option", "active" ); 
// setter
$( ".selector" ).accordion( "option", "active", 2 );

more info here

  • Thank you for your answer. But my issue is, that i would like the accordion state like it is an change it if neccessary. I think i have to learn, which event on the accordion is triggered when the ajax returns.. - Any ideas? – Piezo Pea Jan 27 '13 at 12:11

the event is ajaxSuccess on the child .ui-accordion-content divs

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.