...

View Full Version : How do I center this popup?



Speedy
10-04-2003, 02:21 AM
Hi,

I wanna make this popup pop up in the center of
the surfers screen how do I do that?



<script>
function Bilden(filename,winTitle)
{
var myImage = new Image();
myImage.src=filename;
properties='height=10,width=10';
var imgWindow = window.open('','',properties);

html = '<html>';
html += '<head>';
html += '<title>'+winTitle+'</title>';
html += '</head>';
html += '<body bgcolor="#000000" bottommargin="2" rightmargin="2" topmargin="2" marginheight="2" leftmargin="2" marginwidth="2" onContextMenu="return false">';
html += '<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">';
html += '<tr>';
html += '<td bgcolor="#5e6370">';
html += '<table width="100%" border="0" cellspacing="2" cellpadding="0">';
html += '<tr>';
html += '<td bgcolor="#2F343E">';
html += '<table width="100%" border="0" cellspacing="10" cellpadding="0">';
html += '<tr>';
html += '<td align="center"><img src="'+myImage.src+'" onLoad="resizeTo(document.bild.width+40,document.bild.height+98);" name="bild"></td>';
html += '</tr>';
html += '</table>';
html += '</td>';
html += '</tr>';
html += '<tr>';
html += '<td bgcolor="#2F343E">';
html += '<table width="100%" border="0" cellspacing="10" cellpadding="0">';
html += '<tr>';
html += '<td align="center"><a href="javascript: window.close();"><img src="images/btn_close2.gif" border="0"></a></td>';
html += '</tr>';
html += '</table>';
html += '</td>';
html += '</tr>';
html += '</table>';
html += '</td>';
html += '</tr>';
html += '</table>';
html += '</body>';
html += '</html>';

imgWindow.document.write(html);
}
</script>


the link looks like this:



<a href="javascript:Bilden('pictures/pic01l.jpg','winTitle here');"><img src="pictures/pic01s.jpg" border=0 height=120 width=150 style="filter:alpha(opacity=70)" onMouseOver="high(this)" onMouseOut="low(this)"></a>


thanks in advance
/Speedy

HairyTeeth
10-04-2003, 10:02 AM
Try this:

http://www.codingforums.com/showthread.php?s=&threadid=20234&highlight=center+popup



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum