js怎么弹出子窗口并父窗口不能操作 C:\Users\HS2743\Desktop\DomePlay\123.jpg,跟这个图片一样。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 无语。不懂得传图片就用FTP吧。 showModalDialog:模式窗口, 一种很特别的窗口,当它打开时,后面的父窗口的活动会停止,除非当前的模式子窗口关闭了, 才能操作父窗口.在做网页Ajax开发时,我们应该有时会用到它来实现表单的填写, 或做类似网上答题的窗口. 它的特点是,传参很方便也很强大,可直接调用父窗口的变量和方法. 使用方法:例如: ------------------------------- parent.htm <script> var obj = new Object(); obj.name="51js"; window.showModalDialog("modal.htm",obj,"dialogWidth=200px;dialogHeight=100px"); </script>modal.htm <script> var obj = window.dialogArguments alert("您传递的参数为:" + obj.name) </script> ------------------------------- 2.可以通过window.returnValue向打开对话框的窗口返回信息,当然也可以是对象。例如: ------------------------------ parent.htm <script> str =window.showModalDialog("modal.htm",,"dialogWidth=200px;dialogHeight=100px"); alert(str); </script> modal.htm <script> window.returnValue="http://www.51js.com"; </script> showModalDialog 只有IE支持!楼主可以用div 模拟!用一个半透明div 设置页面可视区域大小把下面内容遮挡住就可以! <html><head runat="server"> <title></title> <style type="text/css"> li { float:left; width:100px; } </style></head><body style=" margin:0px; padding:0px;"> <center> <div style=" background-color:#C0C0C0; width:100%; height:620px;"> <div style=" width:960px; height:40px; border-bottom:black 1px solid"> <ul> <li>系统管理</li> <li>系统管理</li> <li>系统管理</li> <li>系统管理</li> <li>系统管理</li> <li>系统管理</li> <li>系统管理</li> </ul> </div> <div style=" width:960px; height:580px;"> <div style=" width:100px; height:580px; float:left; border-right:black 1px solid"> <p>用户管理</p <p>用户管理</p> <p>用户管理</p> <p>用户管理</p> <p>用户管理</p> </div> <div style=" width:820px; height:580px; float:left; text-align:center;"> <div style=" width:400px; height:350px; margin-left:200px; margin-top:100px;"> <div style=" width:100%; height:20px; text-align:left; background-color:#2466A2">用户添加<span style=" margin-left:300px">关闭</span></div> <div style=" width:100%; height:310px; text-align:left; background-color:White">内容</div> </div> </div> </div> </div> </center></body></html>这个是我用div模拟的图片,你们复制去运行下看看 大概就这样,打开子页面,父页面变灰色,并且也不能操作父页 你还可以考虑使用别人写的JS,我提供一个很不错的JS下载。你可以去看下,下载的文件里面有具体的Demo讲解的。http://nlx0201.download.csdn.net/ input button select是块状元素行内元素还是inline-block元素啊? 关于EXTJS中的dolayout,layout,onlayout,runlayout? JS时间增加问题,求解啊 强控制Iframe问题 请教,如何用CSS或者JS方式把列表分段? IE中的脚本代码如何知道自己所处的<SCRIPT>对象? js 中无法改变层定位的问题。 jsp页面从数据库读出的字段内容(包含回车键)赋给javascript变量时 关于树形菜单的问题 动态生成的<script>标签,如何获得百度地图返回数据呢? jquery的问题 很郁闷! 请教,跪求一段JS投票代码
使用方法:
例如:
-------------------------------
parent.htm
<script>
var obj = new Object();
obj.name="51js";
window.showModalDialog("modal.htm",obj,"dialogWidth=200px;dialogHeight=100px");
</script>
modal.htm
<script>
var obj = window.dialogArguments
alert("您传递的参数为:" + obj.name)
</script>
-------------------------------
2.可以通过window.returnValue向打开对话框的窗口返回信息,当然也可以是对象。例如:
------------------------------
parent.htm
<script>
str =window.showModalDialog("modal.htm",,"dialogWidth=200px;dialogHeight=100px");
alert(str);
</script>
modal.htm
<script>
window.returnValue="http://www.51js.com";
</script>
<head runat="server">
<title></title>
<style type="text/css">
li
{
float:left;
width:100px;
}
</style>
</head>
<body style=" margin:0px; padding:0px;">
<center>
<div style=" background-color:#C0C0C0; width:100%; height:620px;">
<div style=" width:960px; height:40px; border-bottom:black 1px solid">
<ul>
<li>系统管理</li>
<li>系统管理</li>
<li>系统管理</li>
<li>系统管理</li>
<li>系统管理</li>
<li>系统管理</li>
<li>系统管理</li>
</ul>
</div>
<div style=" width:960px; height:580px;">
<div style=" width:100px; height:580px; float:left; border-right:black 1px solid">
<p>用户管理</p
<p>用户管理</p>
<p>用户管理</p>
<p>用户管理</p>
<p>用户管理</p>
</div>
<div style=" width:820px; height:580px; float:left; text-align:center;">
<div style=" width:400px; height:350px; margin-left:200px; margin-top:100px;">
<div style=" width:100%; height:20px; text-align:left; background-color:#2466A2">用户添加<span style=" margin-left:300px">关闭</span></div>
<div style=" width:100%; height:310px; text-align:left; background-color:White">内容</div>
</div>
</div>
</div>
</div>
</center>
</body>
</html>这个是我用div模拟的图片,你们复制去运行下看看 大概就这样,打开子页面,父页面变灰色,并且也不能操作父页
http://nlx0201.download.csdn.net/