PDA

View Full Version : Centering a JavaScript Popup Window



yuriyneo
03-28-2009, 04:05 AM
Hey guys, I have found a code to make a popup window but it doesnt appear centered..like in the middle of the screen, horizontally and vertically..

here is the code..i hope someone can help me


<SCRIPT LANGUAGE="JavaScript">
<!-- William / Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=345,height=170,left = 50,top = 170'); ");
}
// End -->
</script>
<p><div align="center"><a href="javascript:popUp('web.com/play.html')"><img alt="" src="http://web.com/listen.png" align="" border="0"></a></p>

Thanks! I will appreciate it.

jscheuer1
03-28-2009, 06:21 AM
See:

http://www.dynamicdrive.com/dynamicindex8/popwin.htm