Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / JavaScript / December 2006



Tip: Looking for answers? Try searching our database.

open Centred popup and close parent window

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Socrates - 30 Dec 2006 17:22 GMT
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','scrollbars=no,resizable=no,width=300,height=200,status=no,location=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','scrollbars=no,resizable=no,width=300,height=200,status=no,location=no,toolbar=no,menubar=no');window.close()">
</body>
Socrates - 30 Dec 2006 17:30 GMT
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','scrollbars=no,resizable=no,width=300,height=200,status=no,location=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','scrollbars=no,resizable=no,width=300,height=200,status=no,location=no,toolbar=no,menubar=no');window.close()">
</body>

www.sherlockholmesmuseum.com

> Hi - Have tried for half and hour to get this script to work:
>
[quoted text clipped - 30 lines]
> onload="window.opener=top;window.open('http://www.sherlockholmesmuseum.com','Welcome','scrollbars=no,resizable=no,width=300,height=200,status=no,location=no,toolbar=no,menubar=no');window.close()">
> </body>
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.