案例:jQuery案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
  <style>
5
  div { margin:3px; width:40px; height:40px;
6
        position:absolute; left:0px; top:30px; 
7
        background:green; display:none; }
8
  div.newcolor { background:blue; }
9
  </style>
10
11
  <script type="text/javascript" src="/js/jquery.js"></script>
12
</head>
13
14
<body>
15
16
  请点击这里 ...
17
  <div></div>
18
19
<script>$(document.body).click(function () {
20
      $("div").show("slow");
21
      $("div").animate({left:'+=200'},2000);
22
      $("div").queue(function () {
23
        $(this).addClass("newcolor");
24
        $(this).dequeue();
25
      });
26
      $("div").animate({left:'-=200'},500);
27
      $("div").queue(function () {
28
        $(this).removeClass("newcolor");
29
        $(this).dequeue();
30
      });
31
      $("div").slideUp();
32
    });</script>
33
34
</body>
35
</html>
36