<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>无标题页</title>
<script type="text/javascript">
var index=1; //初始化点击层的z-index
function show(div)
{
div.style.zIndex=index++; //显示后index加1
}
</script>
</head>
<body>
<div style="width: 300px; position: absolute; left: 20px; top: 300px; height: 500px;">
<div style="position: absolute; width: 100px; height: 200px; background-color: Red;"
οnclick="show(this)">
</div>
<div style="position: absolute; width: 300px; height: 100px; background-color: black;"
οnclick="show(this)">
</div>
<div id="Layer1" οnclick="show(this)" style="position: absolute; left: 86px; top: 36px;
width: 376px; height: 295px; background-color: #CCCCCC;">
</div>
<div id="Layer2" οnclick="show(this)" style="position: absolute; left: 194px; width: 407px;
height: 315px; background-color: #0066FF;">
</div>
</div>
</body>
</html>