Forum Moderators: open

Message Too Old, No Replies

I need some popup window help.

         

colorspots

10:31 pm on Nov 7, 2003 (gmt 0)

10+ Year Member



I am trying to set up an image gallery on my website. I want the image gallery to open in a pop up.

main page (parent) has 3 different gallery links
gallery 1
gallery 2
gallery 3

I want the links to open up a pop up window or replace the current popup window content with the new content from the links on the main page. So if you click gallery 1 it pops up the popup window (child). If you click gallery 2 (parent) it changes the popup window (child) content. I am having a hard time trying to figure out how to do this. So if someone could provide me with a reference or a simple script to help me I would be appreciative. I have created the script to pop the new window but I can't get the other links on the page to reference the pop up.

Thanks

korkus2000

10:41 pm on Nov 7, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You need to reference the name of the window you set on the window.open call.

window.open("gallery1.htm","gallery","height=300,width=250");

When you call the window.open method again if you reference gallery as the name of the window it should replace the content.

colorspots

6:00 pm on Nov 10, 2003 (gmt 0)

10+ Year Member



thanks that worked great.

colorspots

11:35 pm on Nov 10, 2003 (gmt 0)

10+ Year Member



I thought that I would post the code so that others can learn from it. First code is the link to the popup window.

<a href="gallery_winter.html" onClick="window.open('gallery_winter.html', 'wintergallery', 'status=no,resizable=no,scrollbars=no,width=550,height=433'); return false">Winter Gallery</a>

This is the code I used to link back to the parent window from the popup.

<a href="main.htm" onclick="javascript:opener.location.href='main.htm'; return false">

use

<body onLoad="self.focus()">
on both to have the new loaded page come to focus.