Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    May 2003
    Location
    Stockholm, Sweden
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How do I center this popup?

    Hi,

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

    Code:
    <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:

    Code:
    <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

  • #2
    Regular Coder
    Join Date
    Mar 2003
    Posts
    176
    Thanks
    0
    Thanked 0 Times in 0 Posts


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •