0

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.

2
  • Just init the Accordion again on the ajax success.
    – niksmac
    Commented Jan 27, 2013 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
    Commented Jan 27, 2013 at 12:13

2 Answers 2

0

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

1
  • 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
    Commented Jan 27, 2013 at 12:11
-2

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 and acknowledge you have read our privacy policy.

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