简体   繁体   中英

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. 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. Firefox resizes the window to the appropriate height/width, but also shows the location bar.

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."

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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