案例:jQuery案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<html>
2
<head>
3
<script type="text/javascript" src="/js/jquery.js"></script>
4
<script type="text/javascript">
5
$(document).ready(function(){
6
  $(".btn1").click(function(){
7
  $("p").hide(1000);
8
  });
9
  $(".btn2").click(function(){
10
  $("p").show(1000,showColor);
11
  $("p").css("background-color","red");
12
  });
13
});
14
function showColor()
15
{
16
$("p").css("background-color","green");
17
}
18
</script>
19
</head>
20
<body>
21
<p>This is a paragraph.</p>
22
<button class="btn1">Hide</button>
23
<button class="btn2">Show</button>
24
</body>
25
</html>
26