|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
#c1{
width:500px;
height:400px;
background-color:#00FFFF;
position:absolute;
left: 326px;
/*filter: Alpha(Opacity=20);*/
top: 76px;
}
#c2{
width:200px;
height:100px;
background-color:#0000FF;
position:absolute;
left: 425px;
top: 61px;
/*filter: Alpha(Opacity=100);*/
}
#c3{
width:200px;
height:100px;
background-color:#000000;
position:absolute;
left: 568px;
top: 42px;
}
</style>
<script>
function ceng(othis1,othis){
var ch=document.getElementById(othis1).getElementsByTagName("div").length;
var arr=new Array(ch)
for(var i=1;i<=ch;i++){
arr[i]=document.getElementById("c"+i).style.zIndex;
}
for(var i=0;i<arr.length-1;i++){
for(var j=i+1;j<arr.length;j++){
if(arr[i]<arr[j]){
tp=arr[i];
arr[i]=arr[j];
arr[j]=tp;
}
}
}
MAX=arr[1]+1
var obj = document.getElementById(othis.id);
obj.style.zIndex=MAX
}
</script>
</head>
<body>
<div id="win1">
<div id="c1" onclick="ceng('win1',this)" ></div>
<div id="c2" onclick="ceng('win1',this)" ></div>
<div id="c3" onclick="ceng('win1',this)" ></div>
</div>
<div id="win2">
<div id="c1" onclick="ceng('win2',this)" ></div>
<div id="c2" onclick="ceng('win2',this)" ></div>
<div id="c3" onclick="ceng('win2',this)" ></div>
<div id="c4" onclick="ceng('win2',this)" ></div>
</div>
</body>
</html> |
|