Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I don't want pop up window to be resizable

Tags:

html

browser

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.

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

like image 763
BruceyBandit Avatar asked Nov 21 '11 17:11

BruceyBandit


People also ask

Why can’t I resize windows in Windows 10?

The thing is, some windows allow you to resize them in their width and height, and some don’t. It’s also not uncommon for a standard window function like the minimize / maximize button to be missing or inoperable because the program has disabled its use or removed it altogether.

How to resize an unresizable window or set to a defined size?

5 Tools to Resize an Unresizable Window or Set to a Defined Size 1 Sizer#N#Sizer is a freeware utility that allows you to resize any window to an exact, predefined size. This is... 2 AutoSizer More ...

How can I reduce or increase the size of a window?

There are tools around that can help you reduce or increase the size of windows that normally don’t give the option to do so, or set a window to a preset dimension. Here’s a selection of 5 for you to look at. All tools were tested in Windows 7 64-bit. 1. Sizer

What is the window resizing grippy at the right end?

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.


1 Answers

You can't do this with CSS - you need to pass the resizable parameter to your window.open() function. If you're using an anchor with the target attribute, you need to use JavaScript instead.

JS Example

window.open ("http://URL","mywin","menubar=1,resizable=0,width=350,height=250");

JS & HTML Example

<a href="#"
  onclick="window.open ('http://URL','mywin','resizable=0,width=350,height=250')">Open</a>

Additional Resources

Take a look at the window.open docs on MDN: https://developer.mozilla.org/en/DOM/window.open

According to MDN, Firefox will not support the resizable attribute:

resizable

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.

Starting with Firefox 3, secondary windows are always resizable ( bug 177838 )

like image 182
James Hill Avatar answered Sep 22 '22 17:09

James Hill