Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

window.open to Make Popup Fill Available Screen Size

Posted on 2008-10-13
2
Medium Priority
?
1,097 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
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…
Suggested Courses

885 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