View Full Version : Open New Window From Link!

09-21-2005, 11:38 PM
The following code opens a new window when a user clicks the hyperlink:

<script language="JavaScript">
function openNewWindow(){

<a href="javascript:void(0)" onClick="openNewWindow()">Click</a>

The above does open a new window when the link is clicked but the window gets opened in the "Restored" state. How do I make the window open in the "Maximized" state?



09-22-2005, 12:08 AM
Calculate the size of the screen and add the appropriate width and height parms to open it to that size. My Popup windows tutorial series at http://javascript.about.com/od/popupwindows/ shows how to assign a size to the popup as well as how to set the position on the screen where it is to appear. screen.availWidth and screen.availHeight provide you with the current screen resolution (less the start bar and any other fixed control bars)

09-22-2005, 05:22 AM
Thanks, Stephen, for your help.

I had been to the URL you had cited but couldn't find a solution to my question. I know how to open a new window using JavaScript, control its dimensions, position etc.. but I want the new window to open in the "Maximized" state & not in the "Restored" state. Even if I get the screen width & height using screen.availWidth & screen.availHeight respectively, the new window covers the entire screen (as a normal maximized browser window does) but the window doesn't open in the "Maximized" state. Even the "Maximize" button remains disabled!

I have tried other options as well but none of them cater to my needs!

I guess I have clarified myself as precisely as possible!

Thanks once again,



09-22-2005, 08:44 AM
You can't open popup windows in "Maximized" state.

10-01-2005, 12:59 PM
You can't open popup windows in "Maximized" state.

But we can open it in fullscreen state.

10-03-2005, 07:37 AM
But we can open it in fullscreen state.
But not anymore in IE/XP SP2.
And even then, arpan_de specifically asked for "Maximized" state.