Click to See Complete Forum and Search --> : Window.open - Have a need to NOT resize


ruchir123
12-28-2008, 11:46 PM
Hello,

How do I make a window.open method to open an html file and make it NOT resizable. Below is the code I have:

onclick="window.open('img_1440.html', '','width=600px,height=550px resizable=0');"

This window is going to be a small popup window and we want to make it not resizable.

Thanks,
Ruchir

Kryptonian
12-29-2008, 01:54 AM
Looks like you've forgotten the comma between height and resizable. Also, I believe you're incorrectly borrowing from CSS in specifying the units for the height and width ("px").

Reference: http://www.w3schools.com/htmldom/met_win_open.asp

felgall
12-29-2008, 04:55 PM
'width=600,height=550,resizable=0'

will make the window that size and not resizable provided that your visitor's browser settings don't override that parameter. The entire content of that parameter are suggestions that browsers are not required to follow and so if your visitor has their browser configured to ignore any or all of those options there is nothing you can do about it (for example I have my browser set to open a new tab instead of a new window and so that entire parameter is ignored since the browser is already open to the size I want it to be.

ruchir123
12-30-2008, 12:42 AM
Hello felgall,

If it is related to brower settings - both on IE and firefox, then this behavior of overriding the suggestions with browser settings should be universally applicable to all websites and not just my web page. Right?

I tried to access all other websites such as www.cnn.com and www.businessweek.com and they have pop up window opening in my browser and NOT resizable. How come they are okay?

Thanks,
Ruchir

Fang
12-30-2008, 01:21 AM
No pop-ups on either site. :confused: Specify a link that causes a pop-up.

Pop-ups are always resizable (http://www.quirksmode.org/js/popup.html#t06) in modern browsers.

felgall
12-30-2008, 02:57 PM
There are NO web pages on the web that open a new window in my browser. My browser is configured to always open such requested pages in a new tab and as such the viewport size is always the same as for the other pages I have open in the browser and is automatically resized if I resize my browser. There is no code at all that any web site can use to change that behaviour. The best any web site can do is to include the parameters for what they want as the third parameter in the window.open call and hope that their visitor hasn't overridden those options with their own choices.