PDA

View Full Version : how do I center a pop up window regardless of resolution?


lelales
07-01-2005, 02:16 AM
I want to center a popup window regardless of the browser's resolution.

I guess this is more of a JavaScript question, yet I figured I'd ask :eek:

thanks

Boskic.com
07-01-2005, 02:19 PM
Use this scriptvar width = 640;
var height = 480;
var top = (screen.height - height) / 2;
var left = (screen.width - width) / 2;
var parametar = "top=" + top + ",left=" + left + ",width=" + width + ",height=" + height;
function Popup(page,name) {
window.open(page,name,parametar);
} or download attachment.