复制代码代码如下:
<! doctype html public "-// w3c // dtd xhtml 1.0 transitional // en"
<html xmlns = "http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv = "content-type" content = "text /html ؛ charset = utf-8" />
<title> 简易弹出框 </title>
<type type = "text/css">
.mydiv {
لون الخلفية: #ff6 ؛
الحدود: 5 بكسل Solid #F90 ؛
محاذاة النص: المركز ؛
رفع الخط: 40 بكسل ؛
حجم الخط: 12 بكسل ؛
خط الرصيف: جريئة ؛
Z-index: 99 ؛
العرض: 300 بكسل ؛
الارتفاع: 120 بكسل ؛
اليسار: 50 ٪ ؛/*ff ie7*/
أعلى: 50 ٪ ؛/*ff ie7*/
الهامش اليساري: -150px! مهم ؛/ *ff ie7 */
الهامش: -60px! مهم ؛/ *ff ie7 */
الهامش: 0px ؛
الموضع: ثابت! مهم ؛/*ff ie7*/
الموقف: مطلق ؛/*ie6*/
_top: التعبير (eval (document.compatmode &&
document.compatmode == 'css1compat')؟
documentelement.scrolltop + (document.documentElement.clientheight-this.offsetheight)/2:/*ie6*/
document.body.scrolltop + (document.body.clientheight - this.clientheight)/2) ؛/*ie5 ie5.5*/
}
.bg {
خلفية اللون: #CCC ؛
العرض: 100 ٪ ؛
الارتفاع: 100 ٪
اليسار: 0 ؛
أعلى: 0 ؛/*ff ie7*/
مرشح: ألفا (عتامة = 10) ؛/*أي*//
التعتيم: 0.8 ؛/*ff*/
Z-index: 1 ؛
الموضع: ثابت! مهم ؛/*ff ie7*/
الموقف: مطلق ؛/*ie6*/
_top: التعبير (eval (document.compatmode &&
document.compatmode == 'css1compat')؟
documentelement.scrolltop + (document.documentElement.clientheight-this.offsetheight)/2:/*ie6*/
document.body.scrolltop + (document.body.clientheight - this.clientheight)/2) ؛/*ie5 ie5.5*/
}
/*النهاية*/
</style>
<script type = "text/javaScript">
وظيفة showdiv () {
document.getElementById ('popdiv'). style.display = 'block' ؛
document.getElementById ('bg'). style.display = 'block' ؛
}
وظيفة jousingiv () {
document.getElementById ('popdiv'). style.display = 'none' ؛
document.getElementById ('bg'). style.display = 'none' ؛
}
</script>
</head>
<body>
<div id = "popdiv" style = "display: none ؛"> <br/> 弹框内容 <br/>
<a href = "javaScript: leableiv ()"> 关闭 </a> </viv>
<div id = "bg" style = "display: none ؛"> </div>
<div style = "padding-top: 20px ؛">
<type type = "submit" name = "" value = "点此弹框" onClick = "javaScript: showdiv ()" />
</div>
</body>
</html>