TwelvestoneFront End

basic JQueryUI question: hijacking the event flow for the accordion


Sign in

  • Waiting for Godot ( 730 k posts )
    Just conversation.
  • Thunder Dome ( 23 k posts )
    Photoshop Tennis and Collabs.
  • Photography ( 5.1 k posts )
    For all you shutterbugs, sh...
  • Flash ( 18 k posts )
    ActionScripting to tweens, ...
  • Front End ( 5.9 k posts )
    general front end design an...
  • Back End ( 9.7 k posts )
    serverside scripting, progr...
  • Projects and Theory ( 12 k posts )
    This forum is for discussio...
  • FAQ ( 269 posts )
    All those nagging questions...
  • Design ( 17 k posts )
    graphics & all aspects of g...
  • Purgatory ( 3.6 k posts )
    12stone Jail, feel free to ...
baron ruhstoff
 
2011-07-18

So... I have an instance of a JQueryUI accordion. The default behavior is fine - a click on a tab opens up the panel with the content visible - but I'd like to sex it up a little bit by adding an intro/outro for the panel content: click on a tab, the panel opens, the content transitions in, etc.

Problem is that I don't know how to begin hijacking the flow. In Flash I'd use events. Here... well, here I don't have a clue what I'm doing. k

Advice? Suggestions? Condemnations?

the real me
 
2011-07-18

You can use events here too. There are a couple you could use, change and changestart. change is after transition animation finishes and changestart is before.

$('.ui-accordion').bind('accordionchange', function(event, ui) { ui.newHeader // jQuery object, activated header ui.oldHeader // jQuery object, previous header ui.newContent // jQuery object, activated content ui.oldContent // jQuery object, previous content });

from herehttp://docs.jquery.com/UI/Accordion#events

Sorry, you must be a member to post to a conversation. Either log in or sign up to get involved.
TwelvestoneFront End

basic JQueryUI question: hijacking the event flow for the accordion