Solved

Maximize window size

Posted on 1997-04-21
2
648 Views
Last Modified: 2009-12-16
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
Comment
Question by:etchen
2 Comments
 
LVL 3

Accepted Solution

by:
RM032397 earned 100 total points
ID: 1265263
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
 

Author Comment

by:etchen
ID: 1265264
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now