在jquery UI中降低手风琴的速度 [英] Reduce the speed of a accordion in jquery UI
本文介绍了在jquery UI中降低手风琴的速度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我对此代码有两个问题:
I have two problems with this code:
首先我想降低效果的速度。
First I would like to reduce the speed of the effect.
第二,就像关闭标签的效果一样,然后会出现以下新标签
Second as you would for the effect to operate to close a tab and then there will be the following newly tab
if ($('#sidebar ul').length) {
$("#sidebar ul").accordion({
event: "mouseover",
active: 1,
collapsible: false,
autoHeight: false
});
}
示例网址: http://jsfiddle.net/8pKMh/
推荐答案
对于速度,请使用动画:
if ($('#sidebar ul').length) {
$("#sidebar ul").accordion({
event: "mouseover",
active: 1,
collapsible: false,
autoHeight: false,
animate: 2000 // miliseconds
});
}
来自jquery ui docs:
From the jquery ui docs:
动画
如果以及如何为更改面板设置动画。
If and how to animate changing panels.
支持多种类型:
- 布尔值:值为false将禁用动画。
- 数字:默认缓动的持续时间(以毫秒为单位)。
- 字符串:默认持续时间使用的缓动名称。
- 对象:具有缓动和持续时间属性的动画设置。
- 还可以包含具有上述任何选项的向下属性。
- 当激活的面板具有向下动画时,会出现向下动画索引低于当前活动面板。
- Boolean: A value of false will disable animations.
- Number: Duration in milliseconds with default easing.
- String: Name of easing to use with default duration.
- Object: Animation settings with easing and duration properties.
- Can also contain a down property with any of the above options.
- "Down" animations occur when the panel being activated has a lower index than the currently active panel.
这篇关于在jquery UI中降低手风琴的速度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文