您的位置:首页 > Web前端 > JavaScript

JavaScript点击弹出浮动独立居中窗口

2013-01-30 10:31 531 查看
<script>
function open_box(){
document.all.ly.style.display="block";
document.all.ly.style.width=document.body.clientWidth;
document.all.ly.style.height=document.body.clientHeight;
}
function close_box(theForm){
document.all.ly.style.display='none';
return false;
}
</script>
<p align="center"><input type="button" value="弹出DIV" onClick="open_box()" /></p>
<!-- 浮层框架开始 -->
<div id="ly" align="center" style="position:absolute;z-index:3;display:none;">
<table width="540" height="300" border="1" cellpadding="0" cellspacing="0" style="border-collapse:collapse;" >
<tr>
<td style="background:#73A2d6;" valign="middle" height="10">
<div align="right"><a href="JavaScript:;" onclick="close_box();" style="color:#FFF;">关闭</a> </div></td>
</tr>
<tr>
<td height="130" align="center">这里是内容这里是内容这里是内容这里是内容这里是内容这里是内容这里是内容这里是内容</td>
</tr>
</table>
</div>
<!-- 浮层框架结束-->



                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: