PDA

View Full Version : pop up window


DuffyStark
05-24-2001, 04:55 PM
Is it possible to set the "X" and "Y" of a pop up window made using a javascript? I'd like to put it wherever I want on the screen :-)
thanks

mgb
05-24-2001, 10:34 PM
Yes,

Put this in the head section of the page that LAUNCHES the popup:
<TITLE>centWin</TITLE>
<script language="JAVASCRIPT" type="TEXT/JAVASCRIPT"><!--
if(screen){
topPos=0
leftPos=0
}
function getPage(thePage,wt,ht){
leftPos= (screen.width-wt)/2
topPos = (screen.height-ht)/2
newWin1 = window.open(thePage,'aWin','toolbars=no,resizeable =no,scrollbars=no,left='+leftPos+',top='+topPos+', width='+wt+',height='+ht)
}
// -->
</script>
</HEAD>

And for the Flash button: GetURL("javascript:getPage('yourfilename.html',500,400)")

now you can change topPos and leftPos to whatever you like...

~mgb

DuffyStark
05-25-2001, 09:17 AM
Thank you,
now I'm a little less confused... :D
see you for the next problem!

mgb
05-25-2001, 05:19 PM
You're welcome.

~mgb