Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Maximize window size

Posted on 1997-04-21
2
662 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Index on a Table 6 25
Json Schema 8 32
asp Google Map 2 30
HowTo set a global variable in javascript or jQuery 4 21
Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
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…

856 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