我不希望弹出窗口可调整大小
我有一个弹出窗口,单击按钮后会出现。我不希望弹出窗口可以调整大小。我尝试在 css resize:none
和 ressized:none
中使用,但这并不适用于所有浏览器。
是否有一个可以使用的 css 元素,以便弹出窗口不能在所有浏览器中调整大小,或者是否有很多不同的可调整大小相关的 css 元素,以便我可以使用它们,以便最终所有弹出窗口都不能在所有浏览器中调整大小?
我知道在 window.open 函数中将 css 元素放在哪里,我只是想知道其他 css 方法可以使弹出窗口对于所有浏览器都无法调整大小
浏览器使用(所有最新浏览器):IE,Firefox,Google Chrome,野生动物园和歌剧
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您无法使用 CSS 执行此操作 - 您需要将
ressized
参数传递给您的window.open()
函数。如果您使用带有target
属性的anchor
,则需要改用 JavaScript。JS 示例
JS & HTML 示例
其他资源
查看 MDN 上的
window.open
文档:https://developer.mozilla.org/en/DOM/window.open根据 MDN,Firefox 将不支持 resizing 属性:
You can't do this with CSS - you need to pass the
resizable
parameter to yourwindow.open()
function. If you're using ananchor
with thetarget
attribute, you need to use JavaScript instead.JS Example
JS & HTML Example
Additional Resources
Take a look at the
window.open
docs on MDN: https://developer.mozilla.org/en/DOM/window.openAccording to MDN, Firefox will not support the resizable attribute:
火狐浏览器不支持这个。
看看这里:
我们如何禁用调整大小Firefox 中的新弹出窗口?
此外,使其不可调整大小是一个坏主意。如果您的用户有视觉障碍并设置了大字体怎么办?
Firefox doesn't support this.
have a look here:
how can we disable resizing of new popup window in firefox?
futher more, it's a bad idea to make it not-resizeable. what if your users are visually impaired have have there settings to have large fonts?
迟到总比不到好。得到这个工作:
Better late than never. Got this working: