?
Solved

window.open to Make Popup Fill Available Screen Size

Posted on 2008-10-13
2
Medium Priority
?
1,093 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
[X]
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
  • 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

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
This article discusses how to implement server side field validation and display customized error messages to the client.
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…

719 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