简体   繁体   English

使用window.open()调整chrome浏览器窗口大小的问题

[英]issues with sizing of chrome browser window using window.open()

I'm having issues setting the size of a popup and disabling the location bar in Google Chrome. 我在设置弹出窗口的大小和禁用Google Chrome中的位置栏时遇到问题。 I'm using the following: 我正在使用以下内容:

window.open( "site.html", "site", "top=50,left=50,width=20,height=50,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no" );

Chrome doesn't resize the window to the specified height and width, and also the location bar is still visible. Chrome不会将窗口调整为指定的高度和宽度,并且位置栏仍然可见。 Firefox resizes the window to the appropriate height/width, but also shows the location bar. Firefox将窗口调整为适当的高度/宽度,但还会显示位置栏。

Is there something wrong with the code that i'm using in order to make a new popup window with a fixed width/height that has the location bar, menu bar, scroll bar, status bars disabled? 我使用的代码是否有问题,以便制作一个具有固定宽度/高度的新弹出窗口,并且禁用了位置栏,菜单栏,滚动条和状态栏?

You can't always force a user's browser windows to leave off stuff you don't want to be there. 您不能总是强迫用户的浏览器窗口放弃您不希望出现的东西。 Firefox, for example, provides options to allow a user to refuse requests to disable any of the components of a window created by "window.open." 例如,Firefox提供了允许用户拒绝禁用“ window.open”创建的窗口的任何组件的请求的选项。

Now, as to the size, browsers impose minimums, and I suspect that that's what's getting you. 现在,关于大小,浏览器强加了最低限度,我怀疑这就是让您满意的原因。

You should instead use Floating Dialogs using Javascript. 相反,您应该使用使用Java脚本的浮动对话框。

http://jquery.com/demo/thickbox/ http://jquery.com/demo/thickbox/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM