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 duplic
Problem is the class selector: .text
!= class="test"
I've done that well over 100 times, with the same words :)
Change to: $("div.test").hide("normal");
for a fix.
Update:
It seems jQuery UI 1.8 is the issue, breaking "normal"
as an animation speed.
This is from the jQuery UI forums:
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.
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.
Work's for me... you are wrapping:
$("button").click(function() {
$("div.test").hide("normal");
});
in $(document).ready()
aren't you?
Is "normal" even an option for the speed? I thought slow, fast and a time in milliseconds were the only options.
http://api.jquery.com/hide/
Thank you for all the responses. In my question, I included what I thought was the relevant markup. However, unexpectedly and rather disturbingly, it is the inclusion of the latest jQuery UI (1.8.0) that is breaking "normal". Run the below, it will not work. Comment out the jQuery UI inclusion, and lo and behold, it will work!
<!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>