案例: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
    $("body").animate({backgroundPosition:"40% 40%"},0);
8
  });
9
  $(".btn2").click(function(){
10
    $("body").animate({backgroundPosition:"0% 0%"},0);
11
  });
12
});
13
</script>
14
</head>
15
<body style="background-image:url(/img/eg_background.jpg);background-repeat:no-repeat;background-attachment:fixed;">
16
<p>This is a paragraph.</p>
17
<button class="btn1">Animate</button>
18
<button class="btn2">Reset</button>
19
</body>
20
</html>
21