5

Is there a way to change the default animation that jQuery accordion uses? It appears to be "slide" but I'd like to use a Bounce or Drop effect.

Here's my current code:

$("#accordion").accordion({
    autoHeight: false,
    collapsible: true,
    event: 'click',
    active: 4
});

I'd like to change this from a slide to a drop or a bounce.

Richard Ev
  • 52,939
  • 59
  • 191
  • 278
Travis Smith
  • 359
  • 3
  • 4
  • 12

2 Answers2

4

You can use the animated option for this, for example to get your bounce:

$("#accordion").accordion({ 
  animated: 'bounceslide',
  autoHeight: false, 
  collapsible: true, 
  event: 'click', 
  active: 4
});

The default is 'slide', you can view a demo here.

Nick Craver
  • 623,446
  • 136
  • 1,297
  • 1,155
0

You can use the JQuery UI effects if you want more animations styles. And yes there are bounce and drop effects there too.

Note: You can also construct your own animations styles using animate method.

Richard Ev
  • 52,939
  • 59
  • 191
  • 278
Sarfraz
  • 377,238
  • 77
  • 533
  • 578
  • 4
    Yes, but how do I actually apply those UI animation effects to the accordion code? Where does it go and how does it need to be written? – Travis Smith May 21 '10 at 08:10