Click to See Complete Forum and Search --> : help with this script please


Robert Andrade
08-27-2003, 06:32 AM
Can some please look at this java script for opening a window in the center of the page.

the script works fine but when i view it on a diffrent monitor resualtion the window is not in the center.

can some one help

thanks

<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Idea by: Nic Wolfe (Nic@TimelapseProductions.com) -->
<!-- Web URL: http://fineline.xs.mw -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- 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=750,height=500,left = 137,top = 134');");
}
// End -->
</script>


<!-- STEP TWO: Paste this onLoad event handler into the BODY tag -->

<BODY onLoad="javascript:popUp('http://patanisca-pirolito.com/html/main.htm')">

<!-- Script Size: 0.73 KB -->

pyro
08-27-2003, 07:45 AM
That script sucks, all the way around. Try http://www.webdevfaqs.com/javascript.php#centeredpopup

Robert Andrade
08-27-2003, 09:08 AM
pyro thanks very much for the link it works great but i have just 1 problem i would like it to open automatic and not have to click to open the new window

thanks

pyro
08-27-2003, 09:40 AM
Add this to your <body> tag:

<body onload="openwin('http://www.webdevfaqs.com','600','400');">

Robert Andrade
08-27-2003, 09:54 AM
Pyro i would just like to say thankyou very much. it all works great.

once again Thanks

pyro
08-27-2003, 09:56 AM
You are welcome... :)