Ask a Question related to Macromedia Dynamic HTML, Design and Development.
-
maguskrool #1
popup that closes itself and other popups
Hi.
I'm now working on a website with several links that open multiple popup
windows. Link1, for instance, opens 3 popup windows, the 2 first with images
and other content and the 3rd with a link that should close all open popups. To
achieve this I used the following functions:
/*Array with popup window names*/
var aPopupNames = new Array();
/*Opens one popup*/
function openPopup1 (sUrl, aNames, nWidth, nHeight, nLeft, nTop)
{
aNames.push (window.open (sUrl, '', 'left=' + nLeft + ',top=' + nTop +
',width=' + nWidth + ',height=' + nHeight));
}
/*Closes open popups*/
function closePopups (aNames)
{
for (var i = 0; i < aNames.length; i++) {
aNames[i].close()
}
}
The function openPopup1 opens only one popup, but lets assume it opens more
than one.
So Link1 opens the 3 popup windows, and those popup window names are put into
the aNames array. Now, I have tried using the closePopups function on a link on
the main document and it worked, the popups close correctly. When I tried to
use it in a link on the 3rd popup opened by Link1, though, it doesn't seem to
recognize the aNames array, at least that's why I guess it doesn't work. I've
only been working with javascript for a very short while, so I'm not aware of
specific properties and functions that might solve this problem easily. I
guessed there might be some sort of _parent property as in Flash actionscript,
or some way to refer to the array defined in the main document, or to pass that
array into the 3rd popup so it can be used.
Can anyone help me with this, please? Hope it was clear enough, I'll be happy
to clarify anything you need.
Thank you in advance,
Jo?o
maguskrool Guest
-
Cannot create JavaScript popup menu with Show Popup Menuusing Add Behaviors
Whenever I load a page with this added behavior and test it with my link, I get an "Error on Page" message. Here is what I am doing: Create a... -
Popup menu on popup window
Hi, I want to create a popup menu when a button on a popup window is clicked. I have this in my popup window: myMenu =... -
When window closes
When a user clicks the window close block/x in the top right corner I need to send the browser to a logout script page that logs them out and closes... -
popups advertising to stop popups
Greetings -- Does the title bar of these pop-ups read "Messenger Service?" This particular "sales method" is strikingly similar to the... -
Brown popups offering to give programs to block popups
are these genuine ads to protect windows xp owners or are they spyware ads. as they all sem to want to stop popups, but the most popups i get... -
maguskrool #2
Re: popup that closes itself and other popups
Ok, after a bit of research I discovered the window.opener... It works now when I use
href="javascript:window.opener.closePopups(window. opener.aNames)"
on the link that closes the popups.
maguskrool Guest



Reply With Quote

