Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

popup window

Status
Not open for further replies.

krichard

Technical User
Dec 5, 2001
41
US
Hello...

i have a script that opens up a popup window... Once the popup window opens... i have a link on it that goes to another page... when i click the link it opens the page inside the popup window... can someone help me with my code so that when i click on the link, the popup window closes and the url opens up in my original browser window?

THANKS KIM

Page 1:

<script>
var win= null;
function NewWindow(mypage,myname,w,h){
var winl = (screen.width-w)/2;
var wint = (screen.height-h)/2;
var settings ='height='+h+',';
settings +='width='+w+',';
settings +='top='+wint+',';
settings +='left='+winl;
win=window.open(mypage,myname,settings);
if(parseInt(navigator.appVersion) >= 4){win.focus();}
}
</script>

<body onUnload=&quot;closePopWin()&quot;>

<a href=&quot;javascript&quot; onmouseover=&quot;NewWindow(' true&quot; ><strong> ENTER </strong></a>

Popup Window:

<a href=&quot;gatekeeper-in.html&quot;><img src=&quot;Images/ae2.jpg&quot; width=&quot;122&quot; height=&quot;122&quot; border=&quot;0&quot;></a>
 
this should do it:

<a href=&quot;#&quot; onclick=&quot;opener.location.href = 'gatekeeper-in.html';&quot;><img src=&quot;Images/ae2.jpg&quot; width=&quot;122&quot; height=&quot;122&quot; border=&quot;0&quot;></a>

=========================================================
-jeff
try { succeed(); } catch(E) { tryAgain(); }
 
Hello...

Thanks for your help... i ended up finding another script that does what I want it to do, but now what I am missing is the mousover affect. Basically the popup window works fine when i click on the enter button to open it, but what I want to happen is when I mouseover the enter button I want it to open as well!!! :)

<script language=&quot;javascript&quot;>
// Copyright PlanMagic Corporation 2001-2002 - // This script may only be used with the copyright notices intact on non commercial sites.
// For use on commercial web sites please contact mail@planmagic.com.
<!--
function ShowMenu(URL, WinTitle, WinWidth, WinHeight, WinLeft, WinTop){
attr = &quot;resizable=no,width=&quot; + WinWidth + &quot;,height=&quot; + WinHeight + &quot;,screenX=&quot; + WinLeft + &quot;,screenY=&quot; + WinTop + &quot;,left=&quot; + WinLeft + &quot;,top=&quot; + WinTop + &quot;&quot;;
msgWindow=open(URL, WinTitle, attr);
if (msgWindow.opener == null) msgWindow.opener = self;
}
//-->
</script>

<body onUnload=&quot;closePopWin()&quot;>

<a href=&quot;javascript:ShowMenu('Page2.htm','Page2',800,550,100,50)&quot;><strong> ENTER </strong></a>
 
Just to add the close part to Jeff's post
Code:
<a href=&quot;#&quot; onMousedown=&quot;opener.location.href = 'gatekeeper-in.html';&quot; onMouseup=self.close()> <img src=&quot;Images/ae2.jpg&quot; width=&quot;122&quot; height=&quot;122&quot; border=&quot;0&quot;></a>
 
I think all you will need is this
Code:
<a href=&quot;javascript:ShowMenu('Page2.htm','Page2',800,550,100,50)&quot; onMouseover=&quot;ShowMenu('Page2.htm','Page2',800,550,100,50)&quot;>

hope that helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top