Solved

Maximize window size

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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
jQuery Datatables.js Selecting a Row to get ID 5 37
Rotate images for Web Page 11 27
Calculating percentage 2 30
center navbar (navigation menu) on web page 3 19
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
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…

749 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