87,987
社区成员
发帖
与我相关
我的任务
分享<!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=gb2312" />
<title>无标题文档</title>
<script type="text/javascript" src="jquery-1.11.2.min.js"></script>
<script>
$(document).ready(function(){
$("#fan").click(function(){
$("#demo").css("color","green").slideUp(2000).slideDown(2000);
})
})chaining
</script>
</head>
<body>
<p id="demo"><h2>jQuery,趣味十足!</h2></p>
<button id="fan">点击</button>
</body>
</html>
<!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=gb2312" />
<title>无标题文档</title>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("#fan").click(function(){
$("#demo").css("color","green").slideUp(2000).slideDown(2000);
})
})
//chaining
</script>
</head>
<body>
<!--p标签换成div标签-->
<div id="demo"><h2>jQuery,趣味十足!</h2></div>
<button id="fan">点击</button>
</body>
</html>
浏览器里跑一下就知道啦,js报错了,去掉chaining就好了。
然后你把p换成div就好了。
