PDA

View Full Version : Center a pop-up


empty
02-10-2001, 06:16 PM
Could someone please tell me how to get a pop-up window to open in the center of my screen?

mgb
02-10-2001, 11:59 PM
<SCRIPT LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT">

leftPos = 0
topPos = 0
if (screen){
leftPos = (screen.width-50)/2
topPos = (screen.height-150)/2
}


newWindow = window.open('yourfilename.html','newWin','width=50 ,height=150,scrollbars=no,resizable=no,top='+topPo s+',left='+leftPos+',toolbars=no')
</SCRIPT>
</head>


If you put this in the head section of your page it will launch a new window center screen. Just change the values; width - 50 height -150 to the values you have for the width and height of your movie popup.

mgb

[Edited by mgb on 02-11-2001 at 08:41 PM]