我不想弹出窗口是可调整大小 [英] I don't want pop up window to be resizable

查看:156
本文介绍了我不想弹出窗口是可调整大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个弹出窗口,点击按钮后出现。我不想让弹出窗口可以调整大小。我尝试在css中使用 resize:none resizable:none ,但这不适用于所有浏览器。 >

有一个css元素可以使用,所以流行窗口不能在所有浏览器中调整大小,或有很多不同的可调整大小的相关CSS元素,所以我可以使用它们最终所有弹出窗口在所有broswers中不可调整大小?



我知道在哪里放css元素,在window.open函数中,我只想知道其他css



使用(所有最新浏览器)的浏览器:IE,Firefox,Google Chrome,safari和Opera

解决方案

您无法使用CSS执行此操作 - 您需要将 resizable 参数您的 window.open()函数。如果您对 target 属性使用,则需要使用JavaScript。



JS示例

  window.open // URL,mywin,menubar = 1,resizable = 0,width = 350,height = 250); 

HTML示例

 < a href =#
onclick =window.open http:// URL,mywin,resizable = 0,width = 350,height = 250);



其他资源



查看 window.open docn on MDN: https://developer.mozilla.org/en/DOM/window。打开



根据MDN,Firefox不支持resizable属性:


可调整大小



如果此功能设置为yes,新的辅助窗口
将可调整大小。使用版本1.4,基于Mozilla的
浏览器在状态
bar的右端有一个调整大小的窗口,这确保用户可以调整浏览器窗口的大小,即使
网络作者请求在
这样的情况下,窗口标题栏中的最大化/恢复图标将
禁用,窗口的边框将不允许调整大小,但窗口
将仍然



使用Firefox 3启动
,辅助窗口总是可调整大小(错误 177838



I have a popup window which appears after clicking on a button. I don't want the pop up window though to be resizeable. I tried using in css resize:none and resizable:none but this does not work for all browsers.

Is there a css element that can be used so that pop window can not resizable in all browsers, or is there a lot of different ressizeable related css elements so that I can use them so eventually all pop up windows are not resizable in all broswers?

I know where to put the css elements, in the window.open function, I just want to know other css ways that can make pop up windows not resizable for all browsers

Browsers using (all latest browsers): IE, Firefox, Google Chrome, safari and Opera

解决方案

You can't do this with CSS - you need to pass the resizable parameter to your window.open() function. If you're using an anchor with the target attribute, you need to use JavaScript instead.

JS Example

window.open ("http://URL","mywin","menubar=1,resizable=0,width=350,height=250");

JS & HTML Example

<a href="#"
  onclick="window.open ("http://URL","mywin","resizable=0,width=350,height=250");

Additional Resources

Take a look at the window.open docs on MDN: https://developer.mozilla.org/en/DOM/window.open

According to MDN, Firefox will not support the resizable attribute:

resizable

If this feature is set to yes, the new secondary window will be resizable. Note: Starting with version 1.4, Mozilla-based browsers have a window resizing grippy at the right end of the status bar, this ensures that users can resize the browser window even if the web author requested this secondary window to be non-resizable. In such case, the maximize/restore icon in the window's titlebar will be disabled and the window's borders won't allow resizing but the window will still be resizable via that grippy in the status bar.

Starting with Firefox 3, secondary windows are always resizable ( bug 177838 )

这篇关于我不想弹出窗口是可调整大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆