降低 jquery UI 中手风琴的速度 [英] Reduce the speed of a accordion in jquery UI

查看:19
本文介绍了降低 jquery UI 中手风琴的速度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这段代码有两个问题:

首先我想降低效果的速度.

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/

推荐答案

为了速度,使用 animate:

if ($('#sidebar ul').length) {
    $("#sidebar ul").accordion({
        event: "mouseover",
        active: 1,
        collapsible: false,
        autoHeight: false,
        animate: 2000 // miliseconds
    });
}​

来自 jquery ui 文档:

From the jquery ui docs:

动画

如果以及如何为不断变化的面板设置动画.

If and how to animate changing panels.

支持多种类型:

  • 布尔值:false 值将禁用动画.
  • 数字:默认缓动的持续时间(以毫秒为单位).
  • 字符串:用于默认持续时间的缓动名称.
  • 对象:具有缓动和持续时间属性的动画设置.
    • 还可以包含具有上述任何选项的 down 属性.
    • 当被激活的面板的索引低于当前活动的面板时,会出现向下"动画.

    这篇关于降低 jquery UI 中手风琴的速度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆