Click to See Complete Forum and Search --> : popup windows - open AND close


::bluemoth::
07-09-2003, 06:13 AM
Hello there,

I'd appreciate some help with a popup window that I've opened from my shockwave flash page.

The flash page opens my popup fine, using the following code:


code:--------------------------------------------------------------------------------on (release) {
getURL("java script:NewWindow=window.open('pageone. html','windowone','width=348,height=290,left=0,top
=0,toolbar=No,location=No,scrollbars=No,status=No,
resizable=No,fullscreen=No'); NewWindow.focus(); void(0);");
}--------------------------------------------------------------------------------

Now, the plan was, this particular popup window would have no scrollbars (this works fine). I then wanted to resize this window to fullscreen and open a new page insideit - but, to then activate scrollbars for this new page inside the popup that has no scrollbars.

As this seemed impossible, I've been trying to open my new page in a new popup window, and then get my previous popup window to close itself (behind my new popup window). A little sloppy . . . but it wouldn't appear any different to the user.

This is what I've been trying:

code:--------------------------------------------------------------------------------on (release) {
getURL("java script:NewNewWindow=window.open('pagetwo. html','windowtwo','width=348,height=290,left=0,top
=0,toolbar=No,location=No,scrollbars=Yes,status=No
,resizable=No,fullscreen=No'); NewNewWindow.focus(); void(0);");
getURL("java script:self.close()");
}--------------------------------------------------------------------------------

Result - No new popup window, it just closes the popup.

Anybody able to lend me a helping hand to get this working?

Lotus
07-09-2003, 06:25 AM
Change the code into this:


getURL("java script:self.close()");
getURL("java script:NewWindow=window.open('pagetwo. html','windowtwo','width=348,height=290,left=0,top

=0,toolbar=No,location=No,scrollbars=Yes,status=No

,resizable=No,fullscreen=No'); NewWindow.focus(); void(0);");

That should fix it.

::bluemoth::
07-09-2003, 06:41 AM
Thanks. I'll give that a try.

::bluemoth::
07-09-2003, 09:35 AM
Checked it out.

The new scollbars enabled popup opens fine, but it's parent popup (self) will not close.

I've checked the syntax (even removed the window.open line), and the close script works fine by itself, as does the window.open script. But not together . . .

Any other suggestions . . . ?

Lotus
07-09-2003, 01:14 PM
It seems as if you try to close the wrong name. Try:


getURL("java script:windowone.close()");

::bluemoth::
07-09-2003, 01:58 PM
Already tried that . . . and it din't work.

So, what I've done instead, is open my parent popup with scrollbars, and inserted a scrollbar hiding script in the page.

A little messy perhaps, but now when I open my new page without a scrollbar hiding script inside of the parent popup, the scrollbars appear.

There must be another way, but this has solved the problem.

Now however, I want to replace 'page2.html' with a variable, but can't seem to get it working. The getURL works with the variable without javascript, so I'm guessing that I got my syntax wrong.

I've tried:
_root.link2
'_root.link2'
"_root.link2"

but they don't work.
Any idea what I'm doing wrong?