HTML – 我不希望弹出窗口可以调整大小

前端之家收集整理的这篇文章主要介绍了HTML – 我不希望弹出窗口可以调整大小前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
单击按钮后会出现一个弹出窗口.我不希望弹出窗口可以调整大小.我尝试在css中使用resize:none和resizable:none但这并不适用于所有浏览器.

是否有一个css元素可以使用,以便pop窗口无法在所有浏览器中调整大小,或者是否有很多不同的可重新配置的相关css元素,以便我可以使用它们,所以最终所有弹出窗口都不能在所有broswers中调整大小?

我知道在哪里放置css元素,在window.open函数中,我只想知道其他css方法可以使弹出窗口不能为所有浏览器调整大小

浏览器使用(所有最新浏览器):IE,Firefox,谷歌浏览器,Safari和Opera

解决方法

您无法使用CSS执行此操作 – 您需要将resizable参数传递给window.open()函数.如果您正在使用具有target属性的锚点,则需要使用JavaScript.

JS示例

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

JS& HTML示例

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

其他资源

看一下MDN上的window.open文档:https://developer.mozilla.org/en/DOM/window.open

根据MDN,Firefox不支持resizable属性

resizable

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

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

猜你在找的HTML相关文章