Lee Mundie said:
Does anyone know where I can get a script for a pop-up where I can
control fixed positioning of a popup based on browser resolution?
two res's: 800 x 600 and 1024 x 768
Those are screen resolutions, not browser resolutions. My browser
typically takes up ~900x1000 on a 1600x1200 screen. Since it is an MDI
client, new popups cannot be larger than the visible area of the
browser viewport (~900x900) and cannot be placed outside those bounds
either.
So, don't use screen resolution, it's not relevant to the task. And be very
careful when positioning new windows, since there are several cases where
your attempts fail badly.
With that being said, you position new windows created with
window.open using the third argument. Example:
var win = window.open("someURL.html","windowName",
"width=400,height=300,top=100,left=120,resizable=yes");
Making the position depend on screen resolution (bad choice!) would be:
---
var left=120,top=100;
if (screen.width == 800) {
left = 300;
top = 200;
} else if (screen.width == 1024) {
left = 500;
top = 300;
}
var win = window.open("someURL.html","windowName",
"width=400,height=300," +
"top=" + top + ",left=" + left + ",resizable=yes");
---
You can read more here:
<URL:
http://www.infimum.dk/HTML/JSwindows.html#ref_3_2>
/L