razeghaik1
شنبه 12 مهر 1393, 16:54 عصر
دوستان من 2 تا صفحه دارم به نام ها Default.html و Popup.html.
کد Default.html به صورت زیر هست:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<script type="text/javascript">
var popUpObj;
function showModalPopUp() {
popUpObj = window.open("PopUp.htm",
"ModalPopUp",
"toolbar=no," +
"scrollbars=no," +
"location=no," +
"statusbar=no," +
"menubar=no," +
"resizable=no," +
"width=100," +
"height=100," +
"left = 490," +
"minimizable=no," +
"maximizable=no," +
"top=300"
);
popUpObj.focus();
LoadModalDiv();
}
</script>
<script type="text/javascript">
function LoadModalDiv() {
var bcgDiv = document.getElementById("divBackground");
bcgDiv.style.display = "block";
}
</script>
<script type="text/javascript">
function HideModalDiv() {
var bcgDiv = document.getElementById("divBackground");
bcgDiv.style.display = "none";
}
function OnUnload() {
if (false == popUpObj.closed) {
popUpObj.close();
}
}
window.onunload = OnUnload;
</script>
<span style="font-family: Arial; font-size: 40pt">Modal PopUp Example</span>
<br />
<br />
<br />
<br />
<br />
<span style="font-family: Arial; font-size: small">Click the button below</span>
<br />
<br />
<input id="Button1" type="button" value="button" onclick="showModalPopUp()" />
<br />
<br />
<span style="font-family: Arial; font-size: 20pt">On clicking you will notice the Modal
behaviour</span>
<div id="divBackground" style="position: fixed; z-index: 999; height: 100%; width: 100%;
top: 0; left:0; background-color: Black; filter: alpha(opacity=60); opacity: 0.6; -moz-opacity: 0.8;display:none">
</div>
</body>
</html>
و کد Popup.html هم به صورت زیر:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<style type="text/css">
body
{
font-family: Arial;
font-size: 10pt;
}
</style>
</head>
<body>
<script type="text/javascript">
<!--
function OnClose() {
if (window.opener != null && !window.opener.closed) {
window.opener.HideModalDiv();
}
}
window.onunload = OnClose;
//-->
</script>
<div>
<span style="font-family: Arial; font-size: 20pt">This is a Modal PopUp</span>
</div>
</body>
</html>
که درواقع با کلیک روی دکمه در صفحه اصلی صفحه پاپاپ باز می شه.
من میخوام کاری کنم که تا زمانی که صفحه popoup.html بسته نشه صفحه default.html کاملا غیر دسترس باشه و نشه هیچ کاریش کرد!
ناگفته نماند که به کنترل های صفحه default دسترسی وحود نداره امابه منوهاش وجود داره.میخام کاری کنم که صفحه پاپاپ حتی minimize هم نشه.
دوستان لطفا راهنمای کنید؟
با تشکر
کد Default.html به صورت زیر هست:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<script type="text/javascript">
var popUpObj;
function showModalPopUp() {
popUpObj = window.open("PopUp.htm",
"ModalPopUp",
"toolbar=no," +
"scrollbars=no," +
"location=no," +
"statusbar=no," +
"menubar=no," +
"resizable=no," +
"width=100," +
"height=100," +
"left = 490," +
"minimizable=no," +
"maximizable=no," +
"top=300"
);
popUpObj.focus();
LoadModalDiv();
}
</script>
<script type="text/javascript">
function LoadModalDiv() {
var bcgDiv = document.getElementById("divBackground");
bcgDiv.style.display = "block";
}
</script>
<script type="text/javascript">
function HideModalDiv() {
var bcgDiv = document.getElementById("divBackground");
bcgDiv.style.display = "none";
}
function OnUnload() {
if (false == popUpObj.closed) {
popUpObj.close();
}
}
window.onunload = OnUnload;
</script>
<span style="font-family: Arial; font-size: 40pt">Modal PopUp Example</span>
<br />
<br />
<br />
<br />
<br />
<span style="font-family: Arial; font-size: small">Click the button below</span>
<br />
<br />
<input id="Button1" type="button" value="button" onclick="showModalPopUp()" />
<br />
<br />
<span style="font-family: Arial; font-size: 20pt">On clicking you will notice the Modal
behaviour</span>
<div id="divBackground" style="position: fixed; z-index: 999; height: 100%; width: 100%;
top: 0; left:0; background-color: Black; filter: alpha(opacity=60); opacity: 0.6; -moz-opacity: 0.8;display:none">
</div>
</body>
</html>
و کد Popup.html هم به صورت زیر:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<style type="text/css">
body
{
font-family: Arial;
font-size: 10pt;
}
</style>
</head>
<body>
<script type="text/javascript">
<!--
function OnClose() {
if (window.opener != null && !window.opener.closed) {
window.opener.HideModalDiv();
}
}
window.onunload = OnClose;
//-->
</script>
<div>
<span style="font-family: Arial; font-size: 20pt">This is a Modal PopUp</span>
</div>
</body>
</html>
که درواقع با کلیک روی دکمه در صفحه اصلی صفحه پاپاپ باز می شه.
من میخوام کاری کنم که تا زمانی که صفحه popoup.html بسته نشه صفحه default.html کاملا غیر دسترس باشه و نشه هیچ کاریش کرد!
ناگفته نماند که به کنترل های صفحه default دسترسی وحود نداره امابه منوهاش وجود داره.میخام کاری کنم که صفحه پاپاپ حتی minimize هم نشه.
دوستان لطفا راهنمای کنید؟
با تشکر