Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

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. –  Nikhil M 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

1 Answer 1

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

e.g:

// 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

Your Answer

 
discard

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.