Drupal Answers is a question and answer site for Drupal developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
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

share|improve this answer
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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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