半透明全屏蒙层+全屏屏蔽+内容居中+css
- <!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"/>
- <meta name="author" content="Chomo" />
- <link rel="start" href="http://www.14px.com" mce_href="http://www.14px.com" title="Home" />
- <title>全屏屏蔽、自动居中的lightBox</title>
- <mce:style type="text/css"><!--
- * { margin:0; padding:0; }
- html,body { height:100%; overflow:hidden; font:12px/1.5 simsun;}
- .myPage {
- line-height:3; overflow:auto; width:100%; height:100%;
- }
- .lightBox,
- .popupCover,
- .popupIframe,
- .popupComponent {
- position:absolute; left:0; top:0; width:100%;
- height:100%;
- }
- .popupComponent { z-index:2; display:none;}
- .popupIframe { display:none; _display:block; _filter:alpha(opacity=0);}
- .popupCover { background:#000; opacity:0.7; *filter:alpha(opacity=70);}
- .lightBox { text-align:center; overflow:auto;}
- .lightBoxContent {
- display:inline-block; *display:inline; zoom:1;
- width:300px; padding:10px; background:#fff; border:5px solid #00b4ff;
- vertical-align:middle;
- }
- .lightBoxMaxHeight {
- display:inline-block; vertical-align:middle;
- height:100%; *height:99.5%; width:1px; overflow:hidden;
- margin-left:-1px;
- }
- .lightBoxWrapper {
- display:inline-block; *display:inline; zoom:1;
- text-align:left;
- }
- .lightBoxClose { color:#f00;}
- .lightBoxSubmit {
- margin-top:10px; padding-top:5px; border-top:1px
- solid #ccc;
- }
- .lightBoxSubmit input {
- font-size:12px; padding:0 10px;
- overflow:visible; margin:0 5px;
- }
- --></mce:style><style type="text/css" mce_bogus="1">* { margin:0; padding:0; }
- html,body { height:100%; overflow:hidden; font:12px/1.5 simsun;}
- .myPage {
- line-height:3; overflow:auto; width:100%; height:100%;
- }
- .lightBox,
- .popupCover,
- .popupIframe,
- .popupComponent {
- position:absolute; left:0; top:0; width:100%;
- height:100%;
- }
- .popupComponent { z-index:2; display:none;}
- .popupIframe { display:none; _display:block; _filter:alpha(opacity=0);}
- .popupCover { background:#000; opacity:0.7; *filter:alpha(opacity=70);}
- .lightBox { text-align:center; overflow:auto;}
- .lightBoxContent {
- display:inline-block; *display:inline; zoom:1;
- width:300px; padding:10px; background:#fff; border:5px solid #00b4ff;
- vertical-align:middle;
- }
- .lightBoxMaxHeight {
- display:inline-block; vertical-align:middle;
- height:100%; *height:99.5%; width:1px; overflow:hidden;
- margin-left:-1px;
- }
- .lightBoxWrapper {
- display:inline-block; *display:inline; zoom:1;
- text-align:left;
- }
- .lightBoxClose { color:#f00;}
- .lightBoxSubmit {
- margin-top:10px; padding-top:5px; border-top:1px
- solid #ccc;
- }
- .lightBoxSubmit input {
- font-size:12px; padding:0 10px;
- overflow:visible; margin:0 5px;
- }</style>
- </head>
- <body>
- <div class="popupComponent" id="lightBox">
- <iframe class="popupIframe"></iframe>
- <div class="popupCover"></div>
- <div class="lightBox"> <span class="lightBoxMaxHeight"></span>
- <div class="lightBoxContent">
- <div class="lightBoxWrapper"> 当提示小于一行时文字居中<br />
- </div>
- <div class="lightBoxSubmit">
- <input type="button" value="确定" onclick="hideLayer('lightBox')" />
- <input type="button" value="取消" onclick="hideLayer('lightBox')" />
- </div>
- </div>
- </div>
- </div>
- <div class="popupComponent" id="lightBox2">
- <iframe class="popupIframe"></iframe>
- <div class="popupCover"></div>
- <div class="lightBox">
- <div class="lightBoxContent">
- <div class="lightBoxWrapper"> 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度<br />
- 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度<br />
- 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度<br />
- 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度<br />
- 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度<br />
- 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度<br />
- 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度<br />
- 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度<br />
- 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度<br />
- 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度<br />
- 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度<br />
- 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度<br />
- 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度<br />
- 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度<br />
- 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度<br />
- 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度<br />
- 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度<br />
- 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度<br />
- 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度<br />
- 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度<br />
- 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度<br />
- 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度<br />
- 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度 当内容已经超过了一屏的高度<br />
- </div>
- <div class="lightBoxSubmit">
- <input type="button" value="确定" onclick="hideLayer('lightBox2')" />
- <input type="button" value="取消" onclick="hideLayer('lightBox2')" />
- </div>
- </div>
- <span class="lightBoxMaxHeight"></span> </div>
- </div>
- <div class="myPage"> 假装很丰富的内容<br />
- 假装很丰富的内容<br />
- 假装很丰富的内容<br />
- 假装很丰富的内容<br />
- <div style="text-align:center;" mce_style="text-align:center;">
- <input type="button" value="位于第一屏的按钮" onclick="showLayer('lightBox')" />
- </div>
- 假装很丰富的内容<br />
- 假装很丰富的内容<br />
- 假装很丰富的内容<br />
- 假装很丰富的内容<br />
- <select>
- <option>一个用于测试IE6中是否能覆盖住的select</option>
- </select>
- <br />
- 假装很丰富的内容<br />
- 假装很丰富的内容<br />
- 假装很丰富的内容<br />
- 假装很丰富的内容<br />
- 假装很丰富的内容<br />
- 假装很丰富的内容<br />
- 假装很丰富的内容<br />
- 假装很丰富的内容<br />
- 假装很丰富的内容<br />
- 假装很丰富的内容<br />
- 假装很丰富的内容<br />
- 假装很丰富的内容<br />
- <select>
- <option>又一个用于测试IE6中是否能覆盖住的select</option>
- </select>
- <br />
- 假装很丰富的内容<br />
- 假装很丰富的内容<br />
- 假装很丰富的内容<br />
- 假装很丰富的内容<br />
- <div style="text-align:center;" mce_style="text-align:center;">
- <input type="button" value="位于第二屏中的按钮"onclick="showLayer('lightBox')" />
- <input type="button"value="当内容已经超过了一屏的高度" onclick="showLayer('lightBox2')"/>
- </div>
- 假装很丰富的内容<br />
- 假装很丰富的内容<br />
- 假装很丰富的内容<br />
- 假装很丰富的内容<br />
- 假装很丰富的内容<br />
- 假装很丰富的内容<br />
- 假装很丰富的内容<br />
- 假装很丰富的内容<br />
- 假装很丰富的内容<br />
- 假装很丰富的内容<br />
- 假装很丰富的内容<br />
- 假装很丰富的内容<br />
- </div>
- <mce:script type="text/javascript"><!--
- function showLayer(id) {
- document.getElementById(id).style.display ="block";
- }
- function hideLayer(id) {
- document.getElementById(id).style.display ="none";
- }
- // --></mce:script>
- <!--存在的两个细节性问题:
- 1. 大家可以看到完整demo中并未出现font-size:0;,而在垂直居中法中却出现了。
- 因为font-size:0在完整demo中,将使firefox3.5中读者完整阅读时lightBox的鼠标滚轮失效,原因不详,这一点大家可以作情处理。
- 2. maxHeight这东西只能放在lightBoxContent的后面,因为在opera9.6中会出现bug-->
- </body>
- </html>
转载至:https://blog.csdn.net/sunzuqiang/article/details/5774618
半透明全屏蒙层+全屏屏蔽+内容居中+css的更多相关文章
- css-dialog样式实现弹框蒙层全屏无需JS计算高度兼容IE7
<!DOCTYPE html><html><head> <meta charset="UTF-8"> <title> ...
- jQuery10种不同动画效果的响应式全屏遮罩层
遮罩层有很多今天介绍这个jQuery10种不同动画效果的响应式全屏遮罩层 效果预览 下载地址 实例代码 <div class="container"> <head ...
- windows蓝屏错误小全
作者:siyizhu 日期:2005-11-27 字体大小: 小 中 大 引用内容 0 0x00000000 作业完成. 1 0x00000001 不正确的函数. 2 0x00000002 系统 ...
- 浏览器全屏之requestFullScreen全屏与F11全屏
一.简介 浏览器全屏有两种方式,一种是HTML5新增的requestFullscree全屏,另一种是摁F11实现的全屏,本文将详解两种全屏的特点以及实现代码. 二.requestFullscreen全 ...
- H5实现全屏与F11全屏
最近做项目用到全屏,现总结一下全屏: 1.局部全屏:H5全屏和F11有区别,在这种情况下判断全屏只需要通过H5全屏属性,无论全屏后有无滚动条都可判断. /** * [isFullscreen 判断浏览 ...
- js控制全屏及退出全屏
js控制全屏及退出全屏,网上很多代码例子,我这里需求和标准的有点出入: 1.当用户点击某按钮,触发iframe下的页面全屏. 2.不允许用户退出全屏. 解决第一点,触发全屏可以按照网上的例子,代码如下 ...
- div的全屏与退出全屏
div的全屏与退出全屏 作用:将div全屏与退出全屏,一般播放器使用较多. html按钮: <button onclick="showFull();"> 全屏 < ...
- android开发:全屏和退出全屏
android开发:全屏和退出全屏 from://http://blog.csdn.net/dyllove98/article/details/8831933 2013-04-21 20:31 413 ...
- Android开发经验一判断当前屏幕是全屏还是非全屏
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView ...
随机推荐
- XFF的学习+修改源码--Are you in class
这几天有做天枢CTF的“Are you in class”的题目,虽然以前了解过XFF,但还是没有很好地应用,而且最后居然掉进了一个大坑,且听我细细讲来. 打开题目,首先有个提示“在不在学校主要看 ...
- Codeforces Beta Round #44 (Div. 2)
Codeforces Beta Round #44 (Div. 2) http://codeforces.com/contest/47 A #include<bits/stdc++.h> ...
- JMeter监控内存及CPU ——plugin插件监控被测系统资源方法
jmeter中也可以监控服务器的CPU和内存使用情况,但是需要安装一些插件还需要在被监测服务器上开启服务. 1.需要的插件准备 JMeterPlugins-Standard-1.3.1.zip 下载 ...
- Server2003+IIS6+TP-Link+花生壳配置
Server2003+IIS6+TP-Link+花生壳配置外网一共分四步: 固定Server2003电脑的局域网IP地址. 设置IIS网站中的TCP端口. 在TP-Link中设置转发规则. 申请花生壳 ...
- 音频 PCM 数据的采集和播放
PCM(Pulse Code Modulation)脉冲编码调制 —— 音频的采集与量化过程. PCM数据是最原始的音频数据完全无损,所以PCM数据虽然音质优秀但体积庞大. 为了解决这个问题先后诞生了 ...
- elasticsearch命令
如果安装了x-pack插件,需要验证 curl -u username:passwd 1.查看所有index curl -XGET localhost:/_cat/indices?v 2.清理所有in ...
- 从mysql导入及导出csv
csv导入: load data local infile 'D:/pcode/shu/data/a.csv' into table a fields terminated by ','; csv导出 ...
- Linux 任务管理 && 常用指令
A.linux死机 转自:https://www.deleak.com/blog/2010/10/20/sysrq/ linux死机了怎么办? 曾经啊,对着键盘上 Print Screen/SysRq ...
- C++命名空间学习笔记
1 模块化和界面 任何实际程序都是有一些部分组成的.通过将程序进行模块化可以使我们的程序更加清晰,有助于多人合作和维护. 将一个程序进行模块化以后,当其中一个模块调用另一个模块时,它不需要知道其具体实 ...
- 计算器类(C++&JAVA——表达式转换、运算、模板公式)
运行: (a+b)*c 后缀表达式:ab+c* 赋值: Enter the a : 10 Enter the b : 3 Enter the c : 5 结果为:65 代码是我从的逻辑判断系统改过来的 ...