JavaScript: Position popup window
I want to position a popup window in the center of the browser
window not the center of the screen. This is what I am using to
open the window and the left property works and the top
property doesn't for centering in the screen. So how do I get it to
center in the browser window and if not, how to get the top
property to center correctly?
Code:
function Zoom(imgName,imgWidth,imgHeight,oPosL,oPosT) {
//Center window from center of screen
//oPosL and oPosT are center of screen - (screen.width/2) etc.
var TempLeft = (imgWidth / 2);
var TempTop = (imgHeight / 2);
var PosL = (oPosL - TempLeft);
var PosT = (oPosT - TempTop);
zoomWindow = window.open '', 'zoomWin', 'width='+imgWidth+',height='+imgHeight
+'top='+PosT+',left='+PosL+',toolbar=0,menubar=0,location=0,scrollbars=0')
zoomWindow.window.resizeTo(imgWidth, imgHeight+30);
}
Thanks for any assistance.