DIV透明层遮罩的实现
来源:互联网 发布:profili软件怎么用 编辑:程序博客网 时间:2024/04/30 13:27
例子如下
<!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"><!-- http://topic.csdn.net/u/20090407/17/f4e03fe8-7085-441a-91c7-d34b088ca502.html -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档 </title>
<style type="text/css">
<!--
*{padding:0;margin:0}
.pop{z-index:2;background-color:#FF0000;position:absolute;left:20%;top:20%;width:200px;height:100px;display:none}
.pop h4{height:20px;background:#369;color:#fff;padding:5px 0 0 5px;}
-->
</style>
</head>
<body style="width:100%;height:100%">
<!--首先设置一个层:-->
<div id="pop1" style="z-index:1;background-color:#000;filter: alpha(opacity=30);opacity: 0.5;width:100%;height:100%;position:absolute;left:0px;top:0px;display:none">
</div>
<div id="pop2" class="pop">
<h4>你好 </h4>
<p><a href="zhezhao.htm">baidu</a> </p></div>
<!--弹出层的按钮:-->
<button onclick="show('pop1','pop2')">弹出按钮 </button>
<div>
弹出按钮弹出按钮弹出按钮弹出按钮弹出按钮弹出按钮弹出按钮弹出按钮弹出按钮弹出按钮弹出按钮
</div>
<script type="text/javascript">
function show(o1,o2){
var o1 = document.getElementById(o1);
var o2 = document.getElementById(o2);
o1.style.width = document.documentElement.scrollWidth;
o1.style.height = document.documentElement.scrollHeight
o1.style.display = "block";
o2.style.display = "block";
}
</script>
<div style="height:999px;width:2999px;"></div>
</body>
</html>
没啥可说的。插入代码工具总是插入一些莫名奇妙的字符。
这里有一个Javascript&CSS 透明层遮罩的实现的例子:
http://hi.baidu.com/jerreychen/blog/item/eae16ff4a32bebd0f3d3858a.html
- DIV透明层遮罩的实现
- DIV的透明层实现
- DIV的透明层实现
- html和css实现透明div上的div不透明,也可说父div透明,子div不透明
- DIV透明的方法
- DIV的透明设置
- div+css实现背景透明
- IE和FireFox里div透明效果的实现
- DIV+CSS 实现背景透明,文字不透明
- css实现div背景透明,文字不透明
- css实现div层透明毛玻璃
- div 透明
- div 透明
- 透明窗体的实现
- 透明标签的实现
- 透明窗体的实现
- 透明窗体的实现
- 透明窗口的实现
- myeclipse中java注释乱码的解决
- 浅谈网络游戏《天龙X部》的文件加密格式
- oralce分页-查询21到40条的数据
- vim插件
- Erlang中要注意的小细节
- DIV透明层遮罩的实现
- 利用TIdHttp实现文件下载的分块断点续传
- 未能从程序集“System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”中加载类
- Linux Tutorials Index
- 数据库表,3个字段,姓名,薪水,部门,用一条sql语句求每个部门薪水最高的人姓名
- hibernate 二级缓存
- PHP删除文件夹
- 配置 .vimrc 解决 Vim / gVim 在中文 Windows 下的字符编码问题
- WinCE数据库操作之CeCreateDatabaseEx