哪里错了啊,找不到。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>挑战题</title>
<script src="http://libs.baidu.com/jquery/1.9.0/jquery.js" type="text/javascript"></script>
</head>
<style type="text/css">
div{margin: 10px 0px;border: solid 1px #ccc;width: 280px;}
ul{list-style-type: none;padding: 5px;margin: 0px;display: none;}
li{margin: 3px;}
h4{background-color: #eee;padding: 5px;margin: 0px;}
</style>
<body>
<h3>show()和hide()方法动画方式现实和隐藏元素</h3>
<div>
<h4>我喜欢吃的水果</h4>
<ul>
<li>苹果</li>
<li>柑桔</li>
<li>梨</li>
</ul>
<input type="hidden" value="0">
</div>
<script type="text/javascript">
$(function(){
$("h4").bind("click",function(){
if($("input").val()==0){
$("ul").show(300,function(){
$("input").val(1);
})
}else{
$("ul").hide(300,function(){
$("input").val(0);
}
})
})
</script>
</body>
</html>