PDA

View Full Version : pop up window location


lepetitemonkey
07-04-2001, 03:29 AM
Hello,

is it possible to make a pop up window show up in certain x and y coordinates on your screen? if so, can anyone tell me how?

thanks

jf

Strok
07-04-2001, 08:06 PM
<html>
<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<SCRIPT LANGUAGE="JavaScript" type="text/Javascript">
<!--
function LocatePopUp() {
var iMyWidth;
var iMyHeight;
//gets top and left positions based on user's resolution so hint window is centered.
iMyWidth = (window.screen.width/2) - (150+5); //half the screen width minus half the new window width (plus 5 pixel borders).
iMyHeight = (window.screen.height/2) - (150 + 25); //half the screen height minus half the new window height (plus title and status bars).
var win2 = window.open("http://www.actionscripts.org/","windowname","status=no,height=300,width=300,resizable=no,left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight + ",scrollbars=no");
win2.focus();
}
//-->
</script>

</head>

<body bgcolor="#FFFFFF" text="#000000" onload="LocatePopUp()">

</body>
</html>

Jesse
07-05-2001, 01:17 AM
please also remember to search the forums as this topic has been coverred often