国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 語言 > JavaScript > 正文

js彈出的對話窗口永遠保持居中顯示

2024-05-06 14:20:31
字體:
來源:轉載
供稿:網友
代碼如下:
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title></title>
<style type="text/css">
.Div_Scroll {
position:fixed;
margin:-10px;
visibility:hidden;
background-color:#808080;
opacity:0.6;
z-index:99;
}
.Div_Scroll_Content {
position:relative;
margin-top:20%;
width:inherit;
height:inherit;
}
.Div_AlertWindow {
margin:auto;
width:200px;
height:100px;
background-color:lightblue;
border:5px solid #f00;
}
</style>
<script type="text/javascript">
window.onload = function () {
var alertWindow = $("alertParent");
alertWindow.style.width = window.screen.availWidth + "px";
alertWindow.style.height = window.screen.height + "px";
$("Sure").onclick = function () {
alertWindow.style.visibility = "hidden";
}
}
function ShowAlert() {
var alertWindow = $("alertParent");
alertWindow.style.visibility = "visible";
}
$ = function (id) {
return document.getElementById(id);
}
</script>
</head>
<body>
<div id="alertParent" class="Div_Scroll">
<div class="Div_Scroll_Content">
<div id="AlertWindow" class="Div_AlertWindow">
<input type="button" id="Sure" value="close alert Dialog..." />
</div>
</div>
</div>
<div style="height:1300px; padding-top:200px;" >
<input id="alertButton" type="button" onclick="ShowAlert();" value="Show alert Dialog..."/>
</div>
</body>
</html>

添加遮罩層
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表

圖片精選

主站蜘蛛池模板: 陵川县| 马边| 申扎县| 彩票| 肇庆市| 高唐县| 马鞍山市| 吴江市| 江口县| 霍邱县| 新建县| 平陆县| 大港区| 温泉县| 襄樊市| 庆阳市| 渑池县| 图们市| 吉林市| 太康县| 渭南市| 通州区| 长春市| 许昌县| 嘉鱼县| 金川县| 苗栗市| 大名县| 正定县| 且末县| 嘉黎县| 商南县| 枝江市| 张北县| 宁河县| 仙游县| 钟祥市| 昌乐县| 衡山县| 襄樊市| 宝应县|