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

JS弹出遮罩层

2014-04-15 09:07 489 查看
<html>
<head>
<title></title>

<script type="text/javascript">
function show() {
document.getElementById("xie").style.display = "";//设置display
document.getElementById("content1").style.display = "";
document.getElementById("xie").style.filter = "Alpha(Opacity=50)";//透明度
document.getElementById("content1").innerHTML = "你的内容<input onclick='hide()' type='button' value='确定'/>";
}
function hide() {
document.getElementById("xie").style.display = "none";
document.getElementById("content1").style.display = "none";
}
</script>

</head>
<body>
<div style="width: 100%; background-color: Gray; display: none; height: 100%; position: absolute; left: 0; top: 0;" id="xie">
</div>
<div style="width: 260px; background-color: Blue; display: none; height: 113px; position: absolute; left: 244px; top: 137px;" id="content1">
</div>
<div id="fuck">
<input onclick="show()" type="button" value="显示" />
</div>
</body>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: