jQuery 1.4.2-$(“#foo").hide("normal")损坏了还是发疯了? [英] jQuery 1.4.2 - is $("#foo").hide("normal") broken or am I crazy?

查看:71
本文介绍了jQuery 1.4.2-$(“#foo").hide("normal")损坏了还是发疯了?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道为什么.hide("normal")在jQuery 1.4.2中似乎不起作用吗?它是一个错误,已被删除还是我发疯了?我设法使用几种不同的方案来重复此操作.只需尝试一下:

Does anyone know why .hide("normal") does not seem to be working in jQuery 1.4.2? Is it a bug, has it been removed or am I just crazy? I've managed to duplicate this using several different scenarios. Just try this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.0/jquery-ui.min.js"></script>

<script type="text/javascript">
    $(document).ready(function() {
        $("button").click(function() {
             $("div.test").hide("normal");
        });
    });

</script>
</head>

<body>
    <div class="test">Hello this is a test</div>
    <button>Click</button>
</body>
</html>

推荐答案

问题是类选择器:.text!= class="test"

Problem is the class selector: .text != class="test"

我已经用相同的词完成了100多次:)

I've done that well over 100 times, with the same words :)

更改为:$("div.test").hide("normal");进行修复.

更新: 似乎是 jQuery UI 1.8 的问题,打破了"normal"的动画速度.

Update: It seems jQuery UI 1.8 is the issue, breaking "normal" as an animation speed.

这是来自jQuery UI论坛:

感谢您指出这一点.普通实际上从来都不是有效的速度选项,它是无效文档(过去也存在于jQuery核心文档中)的神话.它起作用的唯一原因是因为无效值会恢复为默认速度.

Thanks for pointing that out. Normal was actually never a valid speed option, it was a myth from invalid documentation (used to exist in jQuery core docs as well). The only reason that it worked is because invalid values fall back to the default speed.

因此,看来至少jQuery UI团队的这个成员并不认为这是一个重大变化,我强烈不同意,希望在下一次更新中将其撤销.

So it seems at least this member of the jQuery UI team doesn't think this is a breaking change, I strongly disagree and hope this is reversed in the next update.

这篇关于jQuery 1.4.2-$(“#foo").hide("normal")损坏了还是发疯了?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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