2

I am creating a simple popup window and the window height will not resize to 30 pixels. It always defaults to 100 pixels. This behavior appears in all browsers. Am I missing something?

var myWindow;
function openWindow(url) 
{
 var windowFeatures = "width=530,height=30,status,resizable=no,scrollbars=0";
 myWindow = window.open(url, "welcome", windowFeatures);
}

Here is my link

<a href='javascript:void(0)' onclick=openWindow('http://www.stackoverflow.com')> Open the window </a>
asked Dec 1, 2010 at 19:08

3 Answers 3

6

No, this is just the way it works. The "features" that you pass in to window.open are simply requests, and the browser is free to ignore any or all of them. Most browsers and/or the underlying OS itself impose a minimum width and height for windows -- there is nothing you can do to alter this via JavaScript.

answered Dec 1, 2010 at 19:12
Sign up to request clarification or add additional context in comments.

6 Comments

So I guess I need to just accept that I need to build the windows out at 100px minimum height eh? Ouch. The design calls for 10 windows on top of one another. Each window at 30px in height. So now I it appears that I will run into a problem with screen resolution and viewable area since the windows will now be over 1000px of total height.
@Preston: 10 windows is quite a lot -- I don't think users are going to like that anyway. May be it's time to rethink your design?
Well the 10 windows create a design. It is intended to be viewed as art, so the target audience are creative types. Much like the music video thewildernessdowntown.com
On this site, thewildernessdowntown.com, they have multiple windows that are tiny in the lower left. I am trying to achieve that. Perhaps this is an HTML 5 feature?
@Preston: Interesting. :) But wouldn't the title bar and other elements remove from the appeal -- or is that part of the art?
|
5

Most browsers set a minimum window size around 100px so malicious users don't go making tiny windows from which to do lousy things. Even a well-intentioned window of sufficiently small size could become difficult for a user to find and close.

Maybe a lightBox or simpleModal type solution would be helpful? You'd have more control over the size of the display area.

answered Dec 1, 2010 at 19:12

2 Comments

Thanks for the input. I am trying to open multiple windows and position relative to each other (one on top of each other), so modals won't do the trick. At least that I know of.
Nope, that's not an option. Consider perhaps arranging your content inside one window - then you can space them close together. You could even add close buttons to each section and let the user hide them. You could even calculate the new height of the window and adjust as they are closed.
1

Ok after a bit of tinkering I forgot about using the resizeTo() method. Can't believe I did not think of this earlier. (Wasted 2 hours)

answered Dec 1, 2010 at 23:27

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.