...

View Full Version : Css popup in center of window



Peuplarchie
05-25-2009, 05:46 AM
Good day to you all,
I'm working on a css popup script.
It work, but I would like the popup to be always in the center of the window.

here is my code :




echo "<a onmouseover=this.style.cursor=\"pointer\" ' onfocus='this.blur();' onclick=\"document.getElementById('".$value."').style.display = 'block' \" ><img src=\"".$directory."/".$value."\" width=\"50px\"></a>\n";
echo "<div id='".$value."' style='display: none; position: absolute; text-align:left; margin: -50px -200px; margin-top:-150px; z-index:50; border: solid black 1px; padding: 10px; background-color: rgb(255,255,225); text-align: justify; font-size: 12px; '>";
echo "<img src=\"".$directory."/".$value."\" /><br />".$value."<br/>";
echo "<div style='text-align: right;'><a onmouseover='this.style.cursor=\"pointer\" ' style='font-size: 12px;' onfocus='this.blur();' onclick=\"document.getElementById('".$value."').style.display = 'none' \" ><span style=\"color:#000000;\">Close</span></a></div></div>";




Thanks!

abduraooft
05-25-2009, 07:30 AM
It work, but I would like the popup to be always in the center of the window. Try to adopt the method described in www.wpdfd.com/editorial/thebox/deadcentre4.html



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum