[Javascript] positioning: window.open()

BEKIM BACAJ Trojani2000 at hotmail.com
Fri Apr 6 06:01:44 CDT 2001


if you're prob is as far as I can understand to open a pop-up window and control it's position
fo instance you've mentioned center  
do this in the script of you're popup.htm
write something in this manner:

self.moveTo(xWidth, xHeight)

var xWidth= 'calculate client available width, devide it with 2, and substract the window size/2 from the same.
Do the same with the  
var xHeight='...'
for instance and you're window will popup always at the absolute center of the available area in the client screen!~
Regards!


----- Original Message -----
From: Ian Turner
Sent: Thursday, April 05, 2001 11:02 AM
To: javascript at LaTech.edu
Subject: RE: [Javascript] positioning: window.open()


Why not open the window with a local url, move it and then load up the
external url using window.location.replace();
I know this is a workaround but...


All the best
Ian

-----Original Message-----
From: javascript-admin at LaTech.edu [mailto:javascript-admin at LaTech.edu]On
Behalf Of Tom Churm
Sent: 05 April 2001 09:30
To: javascript at LaTech.edu
Subject: [Javascript] positioning: window.open()


hi,

i usually use this code to open a new "pop-up window":

<script language="JavaScript">
<!--
function openHelpWindow () {
  helpWindow = window.open ("popup.html", "MyWindow",

"menu=no,toolbar=no,location=no,scrollbars=no,width=800,height=600,res

izable=no");
  helpWindow.moveTo((screen.width-420)/2, (screen.height-310)/2);
  helpWindow.focus();
}
// -->
</script>

i've found that there are errors when an Absolute URL is used, ie:

when the URL for "popup.html" is something like

"http://someserver.com/popup.html".  since i frequently need to center

or position pop-ups, i need to find an alternative.

i saw somewhere coding that uses something like top=100; left=200; to

position a new window, but cannot find any references to this.

any suggestions would be greatly appreciated.

thanks,

tom

_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
http://www.LaTech.edu/mailman/listinfo/javascript


_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
http://www.LaTech.edu/mailman/listinfo/javascript<br clear=all><hr>Get Your Private, Free E-mail from MSN Hotmail at <a href="http://www.hotmail.com">http://www.hotmail.com</a>.<br></p>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20010406/3d85f23f/attachment.htm>


More information about the Javascript mailing list