Reply
Make a popup window close when a new popup opens (2)
Old 08-11-2006, 09:57 PM Make a popup window close when a new popup opens (2)
Experienced Talker

Posts: 36
Location: Castro Valley, CA
In my desire to have a melody played beyond a page, I let a popup window open with the embed for a melody. Now in the middle of webpages, if any one wants to try another song, I let them press another link to open another popup window. My problem is both window plays different music at the same time.

How can I code to let the second popup window close the first one?

Can any one kindly share with me your knowhow on how to code to close the first window when a second popup window is called for?

These are the webpages where two different melodies are called for. We got the permission to play those musics by the way.

Welcome to Mokelumni River School - Lodi, CA area christian school
Annual Calendar - Mokelumni River School - Lodi, CA area christian school
Richard Yim is offline
Reply With Quote
View Public Profile Visit Richard Yim's homepage!
 
When You Register, These Ads Go Away!
Old 08-12-2006, 12:52 AM Re: Make a popup window close when a new popup opens (2)
vangogh's Avatar
Post Impressionist

Posts: 8,923
Name: Steven Bradley
Location: Boulder, Colorado
When you open a window with window.open you should be giving it a name which you can reference from the orignal page. My thought is you would want to build an array with all the names of the possible windows on the page.

Links should be sent to a function that cycles through all the names and closing any that are open using the close()
method, before opening the one from the link.

Here's an article I just found Working with Windows: Referencing Windows
__________________
l Search Engine Friendly Web Design | Van SEO Design
l Tips On Marketing, SEO, Design, and Development | TheVanBlog
l Custom WordPress Themes
| Small Business Forum
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 08-12-2006, 11:41 AM Re: Make a popup window close when a new popup opens (2)
Experienced Talker

Posts: 36
Location: Castro Valley, CA
Thanks Vangogh for taking time to introduce to me close() ,and also REFERENCING idea, of which I still have no idea what is all about yet.

I keep searching more info so that I can figure out eventually how to close the first popup window (named newwindow) by the new popup window ( named newwin).

I have now the following made to open the second popup window.

<a href="popupex.html" onclick="window.close('popupex_0.html'); return popitup('popupex.html'); newwin.moveTo(20,650)">Click here for new song</a>

But still it does not close the first popup window.

Could any one help me?

Welcome to Mokelumni River School - Lodi, CA area christian school (first popup window opens automatically)
Annual Calendar - Mokelumni River School - Lodi, CA area christian school (second popup can be opened by clicking a link for now both play-I want the second one kills the first one automatically)

Thanks folks in advance.

Last edited by Richard Yim : 08-12-2006 at 12:13 PM.
Richard Yim is offline
Reply With Quote
View Public Profile Visit Richard Yim's homepage!
 
Old 08-12-2006, 01:14 PM Re: Make a popup window close when a new popup opens (2)
vangogh's Avatar
Post Impressionist

Posts: 8,923
Name: Steven Bradley
Location: Boulder, Colorado
See if this page DOM:window.close - MDC will help. I think the two functions they use under the close example would be a good way to set things up. The main difference would be that instead of having the name of the file hardcoded into the window.open you would want to pass the name of the file into the funtion and then into the window.open().

Your links would then call closeOpenedWindow followed by openWindow
__________________
l Search Engine Friendly Web Design | Van SEO Design
l Tips On Marketing, SEO, Design, and Development | TheVanBlog
l Custom WordPress Themes
| Small Business Forum

Last edited by vangogh : 08-13-2006 at 03:54 AM.
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 08-12-2006, 03:35 PM Re: Make a popup window close when a new popup opens (2)
Experienced Talker

Posts: 36
Location: Castro Valley, CA
Thanks again Vangogh, for leaving another post.

I tried so many new things without any success and am about to give up.

it appears to me that when the first popup was opened automatically, it does not hold its window name.

I also find out if I open popup window a few times, the second popup window hangs up the system "not responding" according to task manager.

Again thanks for taking time to give me some direction how to tackle this challenge.
Richard Yim is offline
Reply With Quote
View Public Profile Visit Richard Yim's homepage!
 
Reply     « Reply to Make a popup window close when a new popup opens (2)
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12741 seconds with 12 queries