复制代码代码如下:
<!Doctype HTML公共“ - // W3C // DTD XHTML 1.0 Transitional // en”“” http://www.org/tr/tr/xhtml1/dtd/xhtml1-xhtml1-transitional.transitional.dtdd'>
<html xmlns =“ http://www.w3.org/1999/xhtml”>
<头>
<meta http-equiv =“ content-type” content =“ text /html; charset = utf-8” />
<title>简易弹出框</title>
<style type =“ text/css”>
.mydiv {
背景色:#ff6;
边界:5px实心#f90;
文字平衡:中心;
线高:40px;
字体大小:12px;
字体重量:大胆;
Z-Index:99;
宽度:300px;
身高:120px;
左:50%;/*ff IE7*/
顶部:50%;/*ff IE7*/
左键:-150px!重要;/ *ff ie7 */
利润率:-60px!重要;/ *ff IE7 */
保证金顶:0px;
位置:固定!重要;/*ff IE7*/
位置:绝对;/*IE6*/
_top:expression(eval(document.compatmode &&
document.compatmode =='css1 compat')?
纪录Element.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*/
过滤器:alpha(不透明度= 10);/*IE*/
不透明度:0.8;/*ff*/
z索引:1;
位置:固定!重要;/*ff IE7*/
位置:绝对;/*IE6*/
_top:expression(eval(document.compatmode &&
document.compatmode =='css1 compat')?
纪录Element.scrolltop +(Document.DocumentElement.ClientHeight-This.offsetheight)/2:/*IE6*/
document.body.scrolltop +(document.body.clientheight -this.clientheight)/2);/*IE5 IE5.5*/
}
/*结束*/
</style>
<脚本类型=“ text/javascript”>
函数showdiv(){
document.getElementById('popdiv')。style.display ='block';
document.getElementById('bg')。style.display ='block';
}
函数lossiv(){
document.getElementById('popdiv')。style.display ='none';
document.getElementById('bg')。style.display ='none';
}
</script>
</head>
<身体>
<div id =“ popdiv” style =“ display:none;”> <br/> <br/>
<a href =“ javaScript:oflectiv()”>关闭</a> </div>
<div ID =“ bg”样式=“ display:none;”> </div>
<div style =“ padding-top:20px;”>
<input type =“ submit” name =“” value =“点此弹框” onclick =“ javascript:showdiv()” />
</div>
</body>
</html>