1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
<html>
<head>
<title>DIV层切换</title>
<script language="JavaScript" type="text/javascript">
/*********************************************
功能: 通用DIV切换函数
参数: divID --当前DIV的ID号;divName
--要改变的这一组DIV的命名前缀;zDivCount --这一组DIV的个数-1
BY : JetKing 2007.06
*********************************************/
function ChangeDiv(divId,divName,zDivCount)
{
for(i=0;i<=zDivCount;i++)
{
document.getElementById(divName+i).style.display="none";
}
document.getElementById(divName+divId).style.display="block";
}
</script>
</head>
<body>
层切换示例:<br>By:JetKing(www.80Boby.Com)<br>
<span onMouseMove="JavaScript:ChangeDiv('0','JKDiv_',2)"
style="cursor:hand;">内容一</span>
<span onMouseMove="JavaScript:ChangeDiv('1','JKDiv_',2)"
style="cursor:hand;">内容二</span>
<span onMouseMove="JavaScript:ChangeDiv('2','JKDiv_',2)"
style="cursor:hand;">内容三</span>
<div id="BigDIV"
style="border:solid 1px #cccccc;width:460px;margin:10px;">
<div id="JKDiv_0" style="font-size:14px;margin:20px;color:#FF0000;">
内容部分第一区<br><img src="images/common/watermark.gif"></div>
<div id="JKDiv_1"
style="display:none;font-size:14px;margin:10px;color:#FF0000;">
内容部分第二区<br><img src="logo.gif"></div>
<div id="JKDiv_2"
style="display:none;font-size:14px;margin:10px;color:#FF0000;">
内容部分第三区</div>
</div>
</body>
</html>
|