[thelist] centering a popup window.....

Anthony Baratta Anthony at Baratta.com
Wed Jan 31 19:48:48 CST 2001


At 03:39 PM 1/31/2001, you wrote:
>At 03:12 PM 1/31/2001, you wrote:
>>How about top= and left= rather than screenX= and screenY= ?

Both lon kraemer and Peter-Paul Koch deserve major kudos.....

I was way wrong about top and left. But the interesting thing is that you 
can use both and not get in touble.

<SCRIPT language=JavaScript>
<!--
function Login() {
     var x = 0;
     var y = 0;
     var theURL = "http://www.foo.com/login.asp";
     var winName = "login_screen";
     var width = 110;
     var height = 170;

     x = (screen.availWidth - 12 - width) / 2;
     y = (screen.availHeight - 48 - height) / 2;

     winFeatures = "'status=0,scrollbars=0,resizable=0,screenX=" + x + 
",screenY=" + y + ",width=" + width + ",height=" + height + "',top=" + y + 
",left=" + x + "'";
     window.open(theURL,winName,winFeatures);
}
// -->
</SCRIPT>

----
Anthony Baratta
President
Keyboard Jockeys





More information about the thelist mailing list