SoFunction
Updated on 2025-04-07

Segment of style and behavior when implementing lightBox reduces JS page 1/2


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:///TR/xhtml1/DTD/">
<html xmlns="http:///1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="author" content="Chomo" />
<link rel="start" href="http://" title="Home" />
<title>Full screen blocking, auto-centered lightBox</title>
<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;}
</style>
</head>
<body>
<div class="popupComponent" >
<iframe class="popupIframe"></iframe>
<div class="popupCover"></div>
<div class="lightBox">
<span class="lightBoxMaxHeight"></span>
<div class="lightBoxContent">
<div class="lightBoxWrapper">
When the prompt is less than one line, the text is centered[br]
</div>
<div class="lightBoxSubmit">
<input type="button" value="okay" onclick="hideLayer('lightBox')" />
<input type="button" value="Cancel" onclick="hideLayer('lightBox')" />
</div>
</div>
</div>
</div>
<div class="popupComponent" >
<iframe class="popupIframe"></iframe>
<div class="popupCover"></div>
<div class="lightBox">
<div class="lightBoxContent">
<div class="lightBoxWrapper">
When the content has exceeded the height of one screen When the content has exceeded the height of one screen When the content has exceeded the height of one screen [br]
When the content has exceeded the height of one screen When the content has exceeded the height of one screen When the content has exceeded the height of one screen [br]
When the content has exceeded the height of one screen When the content has exceeded the height of one screen When the content has exceeded the height of one screen [br]
When the content has exceeded the height of one screen When the content has exceeded the height of one screen When the content has exceeded the height of one screen [br]
When the content has exceeded the height of one screen When the content has exceeded the height of one screen When the content has exceeded the height of one screen [br]
When the content has exceeded the height of one screen When the content has exceeded the height of one screen When the content has exceeded the height of one screen [br]
When the content has exceeded the height of one screen When the content has exceeded the height of one screen When the content has exceeded the height of one screen [br]
When the content has exceeded the height of one screen When the content has exceeded the height of one screen When the content has exceeded the height of one screen [br]
When the content has exceeded the height of one screen When the content has exceeded the height of one screen When the content has exceeded the height of one screen [br]
When the content has exceeded the height of one screen When the content has exceeded the height of one screen When the content has exceeded the height of one screen [br]
When the content has exceeded the height of one screen When the content has exceeded the height of one screen When the content has exceeded the height of one screen [br]
When the content has exceeded the height of one screen When the content has exceeded the height of one screen When the content has exceeded the height of one screen [br]
When the content has exceeded the height of one screen When the content has exceeded the height of one screen When the content has exceeded the height of one screen [br]
When the content has exceeded the height of one screen When the content has exceeded the height of one screen When the content has exceeded the height of one screen [br]
When the content has exceeded the height of one screen When the content has exceeded the height of one screen When the content has exceeded the height of one screen [br]
When the content has exceeded the height of one screen When the content has exceeded the height of one screen When the content has exceeded the height of one screen [br]
When the content has exceeded the height of one screen When the content has exceeded the height of one screen When the content has exceeded the height of one screen [br]
When the content has exceeded the height of one screen When the content has exceeded the height of one screen When the content has exceeded the height of one screen [br]
When the content has exceeded the height of one screen When the content has exceeded the height of one screen When the content has exceeded the height of one screen [br]
When the content has exceeded the height of one screen When the content has exceeded the height of one screen When the content has exceeded the height of one screen [br]
When the content has exceeded the height of one screen When the content has exceeded the height of one screen When the content has exceeded the height of one screen [br]
When the content has exceeded the height of one screen When the content has exceeded the height of one screen When the content has exceeded the height of one screen [br]
When the content has exceeded the height of one screen When the content has exceeded the height of one screen When the content has exceeded the height of one screen [br]
</div>
<div class="lightBoxSubmit">
<input type="button" value="okay" onclick="hideLayer('lightBox2')" />
<input type="button" value="Cancel" onclick="hideLayer('lightBox2')" />
</div>
</div>
<span class="lightBoxMaxHeight"></span>
</div>
</div>
<div class="myPage">
Pretend to be rich content[br] Pretend to be rich content[br] Pretend to be rich content[br] Pretend to be rich content[br] Pretend to be rich content[br]
<div style="text-align:center;"><input type="button" value="button on the first screen" onclick="showLayer('lightBox')" /></div>
Pretend to be rich content[br] Pretend to be rich content[br] Pretend to be rich content[br] Pretend to be rich content[br] Pretend to be rich content[br]
<select><option>A select that can be covered in IE6</option></select>[br]
Pretend to be rich content[br] Pretend to be rich content[br] Pretend to be rich content[br] Pretend to be rich content[br] Pretend to be rich content[br]
Pretend to be rich content[br] Pretend to be rich content[br] Pretend to be rich content[br] Pretend to be rich content[br] Pretend to be rich content[br]
Pretend to be rich content[br] Pretend to be rich content[br] Pretend to be rich content[br] Pretend to be rich content[br] Pretend to be rich content[br]
<select><option> Another select that can be used to test whether it can be covered in IE6</option></select>[br]
Pretend to be rich content[br] Pretend to be rich content[br] Pretend to be rich content[br] Pretend to be rich content[br] Pretend to be rich content[br]
<div style="text-align:center;"><input type="button" value="button located in the second screen" onclick="showLayer('lightBox')" /><input type="button" value="When the content has exceeded the height of one screen" onclick="showLayer('lightBox2')" /></div>
Pretend to be rich content[br] Pretend to be rich content[br] Pretend to be rich content[br] Pretend to be rich content[br] Pretend to be rich content[br]
Pretend to be rich content[br] Pretend to be rich content[br] Pretend to be rich content[br] Pretend to be rich content[br] Pretend to be rich content[br]
Pretend to be rich content[br] Pretend to be rich content[br] Pretend to be rich content[br] Pretend to be rich content[br] Pretend to be rich content[br]
</div>
<script>
function showLayer(id) {
(id). = "block";
}
function hideLayer(id) {
(id). = "none";
}
</script>
</body>
</html>