案例:jquery案例     状态:可编辑再运行    进入横版
x
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script src="/js/jquery-1.11.1.min.js"></script>
5
<script>
6
$(document).ready(function(){
7
  $("button").click(function(){
8
    $("#div1").fadeTo("slow",0.15);
9
    $("#div2").fadeTo("slow",0.4);
10
    $("#div3").fadeTo("slow",0.7);
11
  });
12
});
13
</script>
14
</head>
15
16
<body>
17
18
<p>演示带有不同参数的 fadeTo() 方法。</p>
19
<button>点击这里,使三个矩形淡出</button>
20
<br><br>
21
<div id="div1" style="width:80px;height:80px;background-color:red;"></div>
22
<br>
23
<div id="div2" style="width:80px;height:80px;background-color:green;"></div>
24
<br>

 运行结果 
 北美留学生论坛