案例:jQuery案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
  <style>div { margin:3px; width:40px; height:40px;
5
        position:absolute; left:0px; top:60px; 
6
        background:green; display:none; }
7
  div.newcolor { background:blue; }
8
  p { color:red; }  </style>
9
10
  <script type="text/javascript" src="/js/jquery.js"></script>
11
</head>
12
13
<body>
14
15
<p>队列长度是:<span></span></p>
16
<div></div>
17
18
<script>
19
var div = $("div");
20
21
function runIt() {
22
  div.show("slow");
23
  div.animate({left:'+=200'},2000);
24
  div.slideToggle(1000);
25
  div.slideToggle("fast");
26
  div.animate({left:'-=200'},1500);
27
  div.hide("slow");
28
  div.show(1200);
29
  div.slideUp("normal", runIt);
30
}
31
32
function showIt() {
33
  var n = div.queue("fx");
34
  $("span").text( n.length );      
35
  setTimeout(showIt, 100);
36
}
37
38
runIt();
39
showIt();
40
</script>
41
42
</body>
43
</html>
44