Click to See Complete Forum and Search --> : centering a pop up


suikoden
11-01-2003, 10:48 AM
Hey guys, first post ever. So show me som love and answer. thanks:D

Basically, i want a window that pops up in the center of the page regardless of the users resolution.

so far i have these scripts which work fine:-

<script language="JavaScript">
function openNewWindow(URLtoOpen, windowName, windowFeatures) { newWindow=window.open(URLtoOpen, windowName, windowFeatures); }
</script> //in my head tag

<a href="#" onclick="window.open('main.htm','enhanced','width=550, height=400, left=0, top=0, toolbar=no, scrollbars=no, status=no, resizeable=no, fullscreen=no')"> //for the link

how can i modify that to get my window to center on the click?

cheers

Suikoden

AdamGundry
11-01-2003, 11:05 AM
http://webdevfaqs.com/javascript.php#centeredpopup

Note that your page must be accessible to users with JS disabled. The above script will load in the same window if that is the case.

Adam