问题描述
我有点击一个按钮后,会出现一个弹出窗口。我不想弹出窗口,虽然是调整大小。我试着使用CSS 调整大小:无
和调整大小:无
,但这并不适用于所有的浏览器工作。
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.
有没有可以使用的CSS元素,这样弹出窗口就可以在所有的浏览器不改变大小,还是有很多不同的ressizeable相关的CSS元素,这样我可以这么最终全部弹出窗口不是在调整大小使用它们所有broswers?
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?
我知道在哪里把CSS元素,在window.open功能,我只是想知道其他的CSS的方式,可以使不可调整大小的所有浏览器
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
使用(所有最新的浏览器)的浏览器:IE,火狐,谷歌Chrome,Safari和Opera
Browsers using (all latest browsers): IE, Firefox, Google Chrome, safari and Opera
推荐答案
您不能用CSS做到这一点 - 你需要在改变大小
参数传递到你的 window.open()
功能。如果您使用的是锚
与目标
属性,则需要使用JavaScript来代替。
You can't do this with CSS - you need to pass the resizeable
parameter to your window.open()
function. If you're using an anchor
with the target
attribute, you need to use JavaScript instead.
JS示例
window.open ("http://URL","mywin","menubar=1,resizable=0,width=350,height=250");
&JS放大器; HTML示例
JS & HTML Example
<a href="#"
onclick="window.open ("http://URL","mywin","resizable=0,width=350,height=250");
其他资源
看看MDN上的 window.open
文档:https://developer.mozilla.org/en/DOM/window.open
据MDN,火狐将不支持可调整大小的属性:
According to MDN, Firefox will not support the resizeable attribute:
可调整大小
如果此功能设置为yes,新的辅助窗口
将调整大小。注:1.4版开始,基于Mozilla
浏览器有一个窗口的状态右端调整充满怀旧气息
酒吧,这确保了用户可以调整即使在浏览器窗口
Web创作要求这个辅助窗口是不可调整大小。在
这种情况下,最大化/还原窗口的标题栏图标会
残疾人和窗口的边框将不会允许调整,但窗口
仍然会通过改变大小在状态栏,充满怀旧气息。
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.
启动
与Firefox 3,辅助窗口总是可调整大小的(错误)
这篇关于我不希望弹出窗口是可调整大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!