469,609 Members | 1,657 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,609 developers. It's quick & easy.

open Centred popup and close parent window

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','Welcome','scrollbar s=no,resizable=no,width=300,height=200,status=no,l ocation=no,toolbar=no,menubar=no,top='+x+',left='+ y+',screenY=200,screenX=100');

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

<body
onload="window.opener=top;window.open('http://www.sherlockholmesmuseum.com','Welcome','scrollbar s=no,resizable=no,width=300,height=200,status=no,l ocation=no,toolbar=no,menubar=no');window.close()" >
</body>

Dec 30 '06 #1
1 2299
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','Welcome','scrollbar s=no,resizable=no,width=300,height=200,status=no,l ocation=no,toolbar=no,menubar=no,top='+x+',left='+ y+',screenY=200,screenX=100');

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

<body
onload="window.opener=top;window.open('http://www.sherlockholmesmuseum.com','Welcome','scrollbar s=no,resizable=no,width=300,height=200,status=no,l ocation=no,toolbar=no,menubar=no');window.close()" >
</body>

www.sherlockholmesmuseum.com
Socrates wrote:
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','Welcome','scrollbar s=no,resizable=no,width=300,height=200,status=no,l ocation=no,toolbar=no,menubar=no,top='+x+',left='+ y+',screenY=200,screenX=100');

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

<body
onload="window.opener=top;window.open('http://www.sherlockholmesmuseum.com','Welcome','scrollbar s=no,resizable=no,width=300,height=200,status=no,l ocation=no,toolbar=no,menubar=no');window.close()" >
</body>
Dec 30 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Marshall Dudley | last post: by
2 posts views Thread by Random | last post: by
23 posts views Thread by Markus | last post: by
6 posts views Thread by mkobus | last post: by
3 posts views Thread by Aaron | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.