找回密码
 注册
搜索
热搜: 回贴
  • 前程无忧官网首页 有什么好的平台可以
  • 最新的销售平台 互联网营销的平台有哪
  • 制作网页的基本流程 网页制作和网页设
  • 【帝国CMS】输出带序号的列表(数字排
  • 网站建设公司 三一,中联,极东泵车的
  • 织梦 建站 织梦网站模版后台怎么更改
  • 云服务官网 哪些网站有免费的简历模板
  • 如何建网站要什么条件 建网站要用什么
  • 吉林市移动公司电话 吉林省退休人员网
  • 设计类毕业论文 网站设计与实现毕业论
查看: 10206|回复: 2

邪恶的z-index

[复制链接]
发表于 2009-11-29 02:12:47 | 显示全部楼层 |阅读模式 IP:江苏扬州
<!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>
发表于 2010-1-5 04:05:03 | 显示全部楼层 IP:香港
不要见一个爱一个,爱的太多,你的爱就要贬值。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )

GMT+8, 2024-10-1 09:46 , Processed in 0.204310 second(s), 14 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表