Solved

window.open to Make Popup Fill Available Screen Size

Posted on 2008-10-13
2
1,058 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

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…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…

706 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now