用showModalDialog显示模态窗口
2008-08-04 13:50
190 查看
这项方法开启一个对话窗口,在这个对话窗口关闭前,其他窗口都无法使用。
语法:
window.showModalDialog(arg1,arg2,arg3)
arg1:要打开的文件url。
arg2:增加属性的对象。这个程序窗口会使用dialogArgument属性取得此对象。
arg3:以分号分隔的样式列表。
在模态窗口中使用window.dialogArguments可获得打开此窗口的引用.
例:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>showModalDialog</title>
<script type="text/javascript">
function openWindow()
{
var myArguments = new Object();
myArguments.参数1 = docunet.all.myColor.value;
window.showModalDialg("dw.htm",myArguments,'');
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<select id="myColor">
<option value ="red">Red</option>
<option value = "green">Green</option>
<option value = "yellow">Yellow</option>
</select>
<button onclick = "openWindow()">showModalDialog</button>
</div>
</form>
</body>
</html>
dw.htm:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>dw.htm</title>
<script type="text/javascript">
function loadForm()
{
document.all.div1.style.backgroundColor = window.dialogArguemnts.参数1;
}
</script>
</head>
<body onload = "loadForm()">
<form id="form1" runat="server">
<div>
<div id = "div1" style="width:100px;height:100px;" />
<button onclick = "window.close();">Close</button>
</div>
</form>
</body>
</html>
语法:
window.showModalDialog(arg1,arg2,arg3)
arg1:要打开的文件url。
arg2:增加属性的对象。这个程序窗口会使用dialogArgument属性取得此对象。
arg3:以分号分隔的样式列表。
在模态窗口中使用window.dialogArguments可获得打开此窗口的引用.
例:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>showModalDialog</title>
<script type="text/javascript">
function openWindow()
{
var myArguments = new Object();
myArguments.参数1 = docunet.all.myColor.value;
window.showModalDialg("dw.htm",myArguments,'');
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<select id="myColor">
<option value ="red">Red</option>
<option value = "green">Green</option>
<option value = "yellow">Yellow</option>
</select>
<button onclick = "openWindow()">showModalDialog</button>
</div>
</form>
</body>
</html>
dw.htm:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>dw.htm</title>
<script type="text/javascript">
function loadForm()
{
document.all.div1.style.backgroundColor = window.dialogArguemnts.参数1;
}
</script>
</head>
<body onload = "loadForm()">
<form id="form1" runat="server">
<div>
<div id = "div1" style="width:100px;height:100px;" />
<button onclick = "window.close();">Close</button>
</div>
</form>
</body>
</html>
相关文章推荐
- 模态窗口小例子window.showModalDialog
- 自定义jquery模态窗口插件无法在顶层窗口显示问题
- jsp 页面缓存 showModalDialog 模态窗口
- 关于模态窗口(showModalDialog)的专题!
- 模态窗口 - showModalDialog打开窗口中获取父窗口js方法
- 模态窗口(showModalDialog)标题丢失或无效问题
- 模态窗口window.showModalDialog
- 弹出模态窗口使背景变灰 showModalDialog
- javascript showModalDialog 多层模态窗口实现页面提交及刷新的代码
- javascript创建模态窗口showModalDialog,showModelessDialog
- 兼容火狐和IE的showModalDialog模态窗口
- 网页显示模式窗口showmodaldialog
- 使用showModalDialog打开模态窗口添加数据后刷新原窗口
- js的showModalDialog模态窗口的使用
- Javascript中用showModalDialog弹出的模态窗口怎样去掉缓存
- window.showModalDialog打开模态窗口父子页面间对话
- JavaScript 模态窗口的使用及传值:window.showModalDialog 和window.showModalessDialog
- 弹出窗口全屏显示:window.showModalDialog与window.open全屏显示
- 关于模态窗口(showModalDialog)----asp.net
- 关于模态窗口(showModalDialog)的专题【收藏】