[thelist] One popup window, different sizes

VOLKAN ÖZÇELİK volkan.ozcelik at gmail.com
Thu Oct 13 00:17:25 CDT 2005


Just out of a hurry to work and didn't look at the code closer but

can window.close property be an answer

var popWin = window.open(whatever);

if(typeof(popWin)!="undefined"&&popWin.closed){
    doStuff
}
else {
   doOtherStuff
}

HTH,
Volkan.

2005/10/13, Robert Vreeland <vreeland at studioframework.com>:
> Try this (not tested)
> ----- In the javascript section -----
> popWin = "";
> Function loadWindow(newTarget, newWidth, newHeight)
> {
>        //test to see if window exists
>        if(popWin != "")
>        {
>        //it does
>                popWin.location = newTarget;
>                popWin.resizeTo(newWidth, newHeight);
>        }
>        else
>        {
>        // doesn't exist yet
>                popWin = window.open(newTarget,,"height=" + newHeight + ",
> width=" + newWidth + ",location=0,menubar=
> 0,resizable=1,scrollbars=0,status=0,toolbar=0");
>        }
>
> }
>
> ------Links in opener window------
> <a href="javascript: void(null)"
> onclick="loadWindow('experience2.html','340','380');">Experience</a>
> <a href="javascript: void(null)"
> onclick="loadWindow('origins3.html','670','485');">Origins</a>
> <a href="javascript: void(null)"
> onclick="loadWindow('cinema.html','315','420');">Cinema</a>
>
> Hope it helps,
> Robert Vreeland
>
> -----Original Message-----
> From: thelist-bounces at lists.evolt.org
> [mailto:thelist-bounces at lists.evolt.org] On Behalf Of Robert Carpenter
> Sent: Wednesday, October 12, 2005 6:53 PM
> To: thelist at lists.evolt.org
> Subject: [thelist] One popup window, different sizes
>
> Hi all-
>
> I have some flash content (3 different swf's) that I'd like to display in
> popup windows. Ideally, I'd like reuse the same window as the user clicks
> the various links in the main opener window, but the swf's are dramatically
> different in size, so I'd like the window to fit tightly to the content as
> each new swf is loaded.
>
> Alternatively, I'd be happy to close the current popup window and reopen it
> with the dimensions of the new swf, and I've worked out a script that seems
> to work dandy in IE/win and Firefox, but is failing miserably in Safari with
> the error "Value undefined (result of expression popWin.close) is not
> object."
>
> I have a suspicion I'm not the first person to want to do this, does anybody
> have a suggestion to improve this script, or any alternative approach?
>
> Thanks in advance!
> -Robert-
>
> ----Script------
>
> function popNew(a,n,h,w)    {
> if((typeof(popWin) != "undefined")){
>    popWin.close();
>    }
> popWin = window.open(a,n,'directories=0,height=' + h + ',width=' + w +
> ',location=0,menubar=0,resizable=1,scrollbars=0,status=0,toolbar=0');
> return false;
> }
> ----------------
>
> ------Links in opener window------
> <a href="_swf/experience.html" target="exp"
> onclick="popNew('experience2.html','exp','340','380');">Experience</a>
> <a href="_swf/origins.html" target="exp"
> onclick="popNew('origins3.html','exp','670','485');">Origins</a>
> <a href="cinema.html" target="exp"
> onclick="popNew('cinema.html','exp','315','420');">Cinema</a>
> --------------------------------
>
>
>
> --
>
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester and archives
> of thelist go to: http://lists.evolt.org Workers of the Web, evolt !
>
> --
>
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
>


--
Volkan Ozcelik
+>Yep! I'm blogging! : http://www.volkanozcelik.com/volkanozcelik/blog/
+> My projects/studies/trials/errors : http://www.sarmal.com/


More information about the thelist mailing list