[thelist] One popup window, different sizes

Robert Carpenter evolt at thebigcrux.com
Wed Oct 12 17:53:24 CDT 2005


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>
--------------------------------





More information about the thelist mailing list