Solved

window.open to Make Popup Fill Available Screen Size

Posted on 2008-10-13
2
1,077 Views
Last Modified: 2008-10-13
In IE6, I want to make a JS popup automatically detect and fill the available screen (except for the Windows taskbar area at the bottom of the screen--I'm not looking for the IE "fullscreen" that literally covers the entire monitor).  I tried this:

function fullWindow() {
window.open('http://www.example.com', 'mywindow', config='width=screen.availWidth,height=screen.availHeight,left=0,top=0,toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizeable=no');
}

But it only opens to about half of the screen size.  It seems like javascript is ignoring the "'width=screen.availWidth, height=screen.availHeight".  How can I make this open to all available height and width?
0
Comment
Question by:FrankTech
  • 2
2 Comments
 

Accepted Solution

by:
FrankTech earned 0 total points
ID: 22702721
Well, I figured it out. The code below works. Turns out the config parameters won't read screen.availWidth and screen.availHeight inside the single quotes, so have to put the parameters into a variable and call it like config = cfg.
function fullWindow() {
 
var wth = screen.availWidth;
var hgt = screen.availHeight;
hgt = hgt - 49;
 
var cfg = "width=" + wth + ",height=" + hgt + ",left=0,top=0,toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizeable=no";
 
window.open('http://www.example.com', 'name', config=cfg)
}

Open in new window

0
 

Author Comment

by:FrankTech
ID: 22702733
Of course, the window identifier ('name' in the above code) does not have to be 'name', and  the hgt = hgt - 49 might need to be different on other monitors. On mine, subtracting 49 prevented the height from covering the Windows task bar.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
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 …
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…

697 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