open Centred popup and close parent window

S

Socrates

Hi - Have tried for half and hour to get this script to work:

I am trying to close the parent window while opening a centred new
child window

I would be grateful if someone could correct the script below which
does open a new window, but not in a centred position.

Here is the link to the url:

www.amw1.com/ebay/newwindow.html

Here is the script I am using;

<head>
<title>new window</title>
<script language="JavaScript">
<!--Begin


window.onload = function() {

x=(screen.availWidth - w)/2;
y=(screen.availHeight - h)/2;
var
choose=window.open('http://www.sherlockholmesmuseum.com...p='+x+',left='+y+',screenY=200,screenX=100');

}
// End -->
</script>
</head>

<body
onload="window.opener=top;window.open('http://www.sherlockholmesmuseum.com...ation=no,toolbar=no,menubar=no');window.close()">
</body>
 
S

Socrates

Sorry - here is the full script:

<head>
<title>new window</title>
<script language="JavaScript">
<!--Begin


window.onload = function() {

x=(screen.availWidth - w)/2;
y=(screen.availHeight - h)/2;
var
choose=window.open('http://www.sherlockholmesmuseum.com...p='+x+',left='+y+',screenY=200,screenX=100');

}
// End -->
</script>
</head>

<body
onload="window.opener=top;window.open('http://www.sherlockholmesmuseum.com...ation=no,toolbar=no,menubar=no');window.close()">
</body>

www.sherlockholmesmuseum.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,829
Messages
2,569,737
Members
45,521
Latest member
maryb

Latest Threads

Top