Page 1 of 1

Window Popup - Center Alignment

PostPosted: Wed Mar 05, 2008 1:58 am
by jay
Whether it be firefox or IE, this script will align the popup to the center of the window.
<!--
<script>
function popup(url)
{
var width = 300;
var height = 200;
var left = (screen.width - width)/2;
var top = (screen.height - height)/2;
var params = 'width='+width+', height='+height;
params += ', top='+top+', left='+left;
params += ', directories=no';
params += ', location=no';
params += ', menubar=no';
params += ', resizable=no';
params += ', scrollbars=no';
params += ', status=no';
params += ', toolbar=no';
newwin=window.open(url,'windowname5', params);
if (window.focus) {newwin.focus()}
return false;
}

</script>

<a>Centered popup window</a>
// -->