javascript 禁用弹出窗口中的 Maximixe、关闭按钮
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16684744/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Disable the Maximixe, Close buttons in popup
提问by Elango Thanumalayan
In my web application(ASP.net), I used a Popup window using JavaScript. It is working perfectly but I need to Disable/Hide the Minimize, Maximize, Close buttons and the resizeable handlerstoo. Is it possible.... If it can be done, let me know how to achieve it.
在我的 Web 应用程序 (ASP.net) 中,我使用了一个使用 JavaScript 的弹出窗口。它运行良好,但我也需要禁用/隐藏最小化、最大化、关闭按钮和可调整大小的处理程序。有可能吗....如果可以做到,请告诉我如何实现。
My JavaScript is as follows:
我的 JavaScript 如下:
function ApproveClick(url)
{
newwin =window.open(url,'PopupWindow','left=50, top=50, height=200, width=500,
toolbars=no,menubar=no,location=no,scrollbars=no,resizable=0,status=yes');
if(window.focus)
{
newwin.focus();
}
}
回答by Srikanth
you could also use jQuery dialog box or MS Ajax control toolkit Modal Popup..
您还可以使用 jQuery 对话框或 MS Ajax 控件工具包 Modal Popup..
回答by buhtla
If you are looking for a cross browser solution (supporting at least IE, Firefox and Chrome), and trying to implement it only through parameters of window.open method, this is not possible. You can play around with dialog=yes,minimizable=no,maximizable=no options to see results but I suppose you won't be satisfied.
如果您正在寻找跨浏览器解决方案(至少支持 IE、Firefox 和 Chrome),并试图仅通过 window.open 方法的参数来实现它,这是不可能的。您可以使用 dialog=yes,minimizable=no,maximizable=no 选项来查看结果,但我想您不会满意。
For example, in Chrome popups will always be resizeable when you are using window.open function.
例如,在 Chrome 中,当您使用 window.open 函数时,弹出窗口将始终可以调整大小。
So if you are looking for full control of your popups, go with something like javascript dialog (jQuery for example).
因此,如果您正在寻找对弹出窗口的完全控制,请使用 javascript 对话框(例如 jQuery)之类的东西。