我们在用windows的时候,按一个button可以弹出子窗口,然后在子窗口操作,等到子窗口返回,父窗口才继续监听事件。
js能否实现这样的效果,如果能的话怎么做比较好呢?
js能否实现这样的效果,如果能的话怎么做比较好呢?
解决方案 »
- 问几个正则表达式问题
- 如何在javascript中匹配反斜杠呀,最好有例子
- extjs的multiselect怎么setvalue啊?
- JavaScript乱码的问题
- javascript高手,救命啊!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- 急:请教一个vml中文字摆放位置的问题
- 搞了几个小时了,都没有搞定!难吗?为什么不行?
- 为什么我用window.history.back()有的时候返回到前一页输入的信息会丢失呢?
- 怎样让页面自动识别 800*600 还是 1024*768
- 哪位兄弟帮我看看这段代码有什么毛病?iStepMode返回值为3,但alert(here);无反应。但有时在程序的开头加上alert();便会正常执行。
- 正则表达式小问题
- IE中使用jquery load的问题
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
#divId { width:100px; height:100px; margin:0 auto; background-color:#F00; }
</style>
</head><body>
<div id="divId"></div>
<script type="text/javascript">
var divs = document.getElementById("divId");
divs.onclick = function() {
var wWidth = Math.max(document.documentElement.scrollWidth,
document.documentElement.clientWidth);
var wHeight = Math.max(document.documentElement.scrollHeight,
document.documentElement.clientHeight);
var touDiv = document.createElement("div");
touDiv.style.position = "absolute";
touDiv.style.left = 0;
touDiv.style.top = 0;
touDiv.style.width = wWidth + "px";
touDiv.style.height = wHeight + "px";
touDiv.style.backgroundColor = "#666666";
document.body.appendChild(touDiv);
var newDiv = document.createElement("div");
newDiv.style.position = "absolute";
newDiv.style.zIndex = 500;
newDiv.style.width = "400px";
newDiv.style.height = "400px";
newDiv.style.margin = "0 auto";
newDiv.style.backgroundColor = "#F00";
document.body.appendChild(newDiv);
}
</script>
</body>
</html>
1:使用showModalDialog弹出新窗口
2:使用div去模拟模态化窗口[建议];这种方法或是插件在网上好多
jquery Dialog可以
artDialog也可以
url:子窗口路径
arguments,父窗口传给子窗口的参数,子窗口通过window.dialogArguments进行获取。
features:描述子窗口的特征,具体设置看文档。