• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 693
  • Last Modified:

Maximize window size

basic question

when opening a new window using window.open,
how do you ensure the window is open to its largest capable
size?  This meaning the window must fill the user's screen, therefore a 640X480 user will have his window sized to 640x480 and a 1024x768 user will have his window sized to 1024x768.  I guess the real question is that this window needs to be maximized as if the user clicked on the maximize button on the title bar.

This only pertains to Netscape Navigator 3.0 and above.  I don't want to use VBScript as I already know  how to do that and I have made sure my script detects if a user is using MSIE3.0+
0
etchen
Asked:
etchen
1 Solution
 
RM032397Commented:
Omit the dimensions, for a full screen window : ASSUMING that the current window is fullscreen. If not, the new window will be the same size as the current window. BNooks may tell you that javascript defaults to full screen size when height and width are not specified - but I find that that is not true.

You could hardcode the pixel sizes for the main screen specs. then give the user a choice with , say radio buttons, to select the appropriate size. Or you could suggest to the user that they make the window full screen.

0
 
etchenAuthor Commented:
I have tried that, but the problem occurs when  the user's window is smaller than screen size.  Somehow, in Netscape, when you open a new window, the screen size can be no larger than the one calling it.  I was wondering how I could make the window larger automatically.  If there is no way, then I will except your answer.  But just incase anyone else is reading this, I offer a better solution to getting the screen resolution.  Below is an email I got from lhs@sarto.com who told me:

John Mark Mitchell published a solution based on Java a couple of weeks
ago :
if (navigator.javaEnabled())
           {
           var toolkit = java.awt.Toolkit.getDefaultToolkit();
               var screen_size = toolkit.getScreenSize();
           wz = screen_size.width;
           hz = screen_size.height;
                   }

This should give you the resolution of the monitor!  It employs
Javascript to extract from the Default toolkit in NN Java the values of
the Sreen Width (screen_size.width) and (screen_size.height).    


I've tested this and it works perfectly.              
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now