Maximize

Jack Michaelson's picture

He has: 1,733 posts

Joined: Dec 1999

When I open a window using window.open(), how do I prevent that window to be maximized? I tried 'maximize=no' but that won't work Sad

Thanks in advance,

Shakespeare: onclick || !(onclick)

They have: 99 posts

Joined: May 1999

The following code works fine for me. Make sure that you keep the window.open code all on one line. The second line is used to set up the window.opener allowing reference between window and calling frames.

win_name=window.open("pathtofile.html",win_name,'width=600,height=300,toolbar=no,location=no,directories=no,status=no,menubar=noscrollbars=no,resizable=no,left=100,top=100,screenX=100,screenY=100');

//this line sets up the windows opener
win_name.opener=self;

Jack Michaelson's picture

He has: 1,733 posts

Joined: Dec 1999

You probably use NS, right?

They have: 99 posts

Joined: May 1999

Actually, I deplore Netscape....it has caused me many a problem w/ JavaScript!

I use that script to open several windows on my site. If you go to edisti.com and click on login on the left sidebar, the window that is opened uses that script.

IE does not let you maximize the window.

If your experience is different, what browser/rev are you running.

Tazman

Jack Michaelson's picture

He has: 1,733 posts

Joined: Dec 1999

Aah, well, I was looking for a script that disables maximize in IE.
If that's not possible, I think my search is over...Sad

Thanx anyway

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

zerocattle.com/examples/popUp.html

Jack, I've answered this question what seems like weekly, so here I go again, just for you!

The little piece that you put in the code (see above for cross-browser, popUp window code that contains all the important bits, tutorial links to irt.org et cetera), is resizable=no in the third section of attributes.

That way a window CANNOT be resized (nor maximized) in IE, Netscape, et cetera.

You can only control the settings of windows that *you* open (not the user), but using window.open there is no reason why you can't make it impossible to resize it.

Smiling Suzanne

P.S. Tazman sort of answered this question right away, but his code has syntax/typing errors in it. That's all.

And be careful of your spelling, too.. Smiling I fixed a pile of windows for a client where the former "production specialist" had spelled resizable "resizeable". *sigh*

They have: 99 posts

Joined: May 1999

Point taken Suzanne....Wink
See what happens when I try to fire off a quick email...

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.