Window Popup - Center Alignment

Programming for Search Engines 101. An area for avid PHP and .NET developers to chat about Programming techniques and how to make better use of search engines.

Moderator: Moderators

Window Popup - Center Alignment

Postby jay » Wed Mar 05, 2008 1:58 am

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>
// -->
jay
 
Posts: 475
Joined: Wed Nov 22, 2006 12:05 am
Location: Cochin, India.

Return to Programming

Who is online

Users browsing this forum: No registered users and 5 guests