开发者

How do I change the animation style of a jQuery Accordion?

Is there a way to change the default anim开发者_如何学JAVAation 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.


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜