在主窗口调用window.showModalDialog,弹出一个子窗口。
现在希望弹出子窗口以后,主窗口能够最小化,然后关闭子窗口以后,主窗口能够自动复原成最大。
请问一下用js怎么实现?
对js不是太熟悉,希望能给个例子。
现在希望弹出子窗口以后,主窗口能够最小化,然后关闭子窗口以后,主窗口能够自动复原成最大。
请问一下用js怎么实现?
对js不是太熟悉,希望能给个例子。
解决方案 »
- 页面焦点控制问题
- onclick无效的问题
- 关于java的学习
- 希望有人能帮我解决它
- 发现FireFox3终于支持showModalDialog了,让我的Web系统有机会跨浏览器,散分以贺之。
- 请问这个JS脚本让火狐兼容该怎么改,谢谢帮下
- 怎样设置网页的打印区域?
- [求助]<a href="ProjectLayout_Query.aspx?QueryType='+document.all('ip_hid_QueryType').value">错在哪里?
- 问一个JAVASCRIPT表单提交问题急! 谢谢 !
- 请教一段script
- 菜鸟问题 继续请教!
- Web IM 前端测试原型,第一期(单一时钟 + 函数步长)
b.html父窗口<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>父窗口</title>
</head><body>
<input type="button" onclick="openWindow()" value="click">
</body>
<script language="javascript">
function max_window(){
var window_width=screen.availWidth
var window_height=screen.availHeight
window.resizeTo(window_width,window_height)
window.moveTo(0,0)
}function min_window(){
window.resizeTo(0,0)
window.moveTo(1600,1600)
}function openWindow(){
window.showModalDialog("b1.html", window,"dialogHeight:200px;dialogWidth:300px");
}</script>
</html>b1.html子窗口<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>子窗口</title>
</head><body>
</body>
<script language="javascript">
var parentWin=window.dialogArguments;
parentWin.min_window(parentWin);
window.onbeforeunload = function(){
parentWin.max_window();
}
</script>
</html>
不过模态窗口的情况下,大小最小只能到100,不能缩到0,另外,也不能移出桌面以外。
有没有什么办法可以回避一下呢?
我现在的问题是主窗口是沾满屏幕的,弹出子窗口以后就不能把子窗口的内容和其他程序的内容进行比较了。
(ALT+TAB切换起来,感觉比较不是太方便。