izlik
Feb 24th 2009, 4:17 pm
Hello. the javascript code bellow is for a popup window. currently the popup appears at the top left of my screen, how can i make it center itself once it popups?
<SCRIPT TYPE="text/javascript">
<!--
function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
href=mylink;
else
href=mylink.href;
window.open(href, windowname, 'width=400,height=200,scrollbars=yes');
return false;
}
//-->
</SCRIPT>
'<A HREF="pop.php?file=$file" onClick="return popup(this)">' . $file . '</A>'
<SCRIPT TYPE="text/javascript">
<!--
function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
href=mylink;
else
href=mylink.href;
window.open(href, windowname, 'width=400,height=200,scrollbars=yes');
return false;
}
//-->
</SCRIPT>
'<A HREF="pop.php?file=$file" onClick="return popup(this)">' . $file . '</A>'