半透明全屏蒙层+全屏屏蔽+内容居中+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 ...
随机推荐
- Round Numbers(数位DP)
Round Numbers http://poj.org/problem?id=3252 Time Limit: 2000MS Memory Limit: 65536K Total Submiss ...
- Codeforces Beta Round #73 (Div. 2 Only)
Codeforces Beta Round #73 (Div. 2 Only) http://codeforces.com/contest/88 A 模拟 #include<bits/stdc+ ...
- 方法装饰器(Decorator)
代码: function enhance(target, key, descriptor) { const method = descriptor.value; let extraSpeed = 50 ...
- 微信小程序接入百度统计
一. 百度统计添加应用,获取appkey和微信小程序统计sdk: 1. 百度统计首页,点击“我的全部应用”右侧的添加按钮: 2. “应用类型”选择小程序统计,选择微信小程序,填写应用名称信息,选择内容 ...
- RTP格式解析
一般为12字节,16字节头(转自https://www.cnblogs.com/qingquan/archive/2011/07/28/2120440.html) 概述: 实时传送协议(Real-ti ...
- Springboot学习02-webjars和静态资源映射规则
Springboot学习01-webjars和静态资源映射规则 前言 1-以前我们在IDEA中创建一个项目,添加web依赖包,我们现在是一个web应用,应该在man目录下面有一个webapp文件夹,将 ...
- swift - 启动APP 黑屏
https://blog.csdn.net/chengkaizone/article/details/50478045
- [Java]Spring Ioc讲解,不怕你不懂
原文地址 引述:IoC(控制反转:Inverse of Control)是Spring容器的内核,AOP.声明式事务等功能在此基础上开花结果.但是IoC这个重要的概念却比较晦涩隐讳,不容易让人望文生义 ...
- axios基本使用
1,安装axios cnpm install axios --save 2.在main.js里面引入 import axios from 'axios' /*解决在其他组件中不能用*/Vue.prot ...
- sql 查询某个字段出现的次数
表名随便起个 testtable 那么有这么一个需求,利用你所学的sql语句 单表查询出下表的结果 也就是统计某个时间某个值出现的次数其实一开始我是很懵,毕竟之前也没做过,只能怪自己学得太浅了.过后我 ...