Closed Thread Icon

Preserved Topic: Closing a window Pages that link to <a href="https://ozoneasylum.com/backlink?for=18195" title="Pages that link to Preserved Topic: Closing a window" rel="nofollow" >Preserved Topic: Closing a window\

 
Author Thread
Plankity
Nervous Wreck (II) Inmate

From: us
Insane since: Apr 2001

posted posted 04-26-2001 08:42

I'm trying to do a page for a client that includes links to several reviews: each review loads in a popup window with it's own height and width.

The problem: if a user reads a review and then goes back to the list of other reviews without closing the latest window -- the new review opens in the 'latest' window and appears all out of sync, design-wise.

Is there some way of closing the first popup when linking to the next?

Extra info: the main page is nested in frames, with a blank one pixel frame that launches the individual popups.

This client is an artist and loves this whole treatment (except for the problem). Have I painted myself into a corner on this, or is there a fairly easy out???

Thanking you all, in advance,

plankity

Boudga
Maniac (V) Mad Scientist

From: Jacks raging bile duct....
Insane since: Mar 2000

posted posted 04-26-2001 16:49

wonderful things can be done with dHTML layer hiding *hint*

Plankity
Nervous Wreck (II) Inmate

From: us
Insane since: Apr 2001

posted posted 04-26-2001 17:23

thanks for the hint: can anyone translate?

kat
Paranoid (IV) Inmate

From: memphis TN
Insane since: Apr 2001

posted posted 04-26-2001 18:01

you gotta name each window a different thing...


<a href="#" onClick="win1 = window.open('url','win1',otherattributes..)">

{ kat ; mmm.. a site! }

Plankity
Nervous Wreck (II) Inmate

From: us
Insane since: Apr 2001

posted posted 04-26-2001 18:35

OK: so then I can eliminate the frames scheme for assigning different attributes for different popups? But how would I close an existing window?

I guess I'm a neophyte when it comes to dHTML/Javascript -- my sincere apologies for being so dense...

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 04-26-2001 19:05

when you open your window name it

mywindow = window.open( blah blah blah.............

Now close it before opening another one. Name them all the same thing and it will close

mywindow.close()
mywindow = window.open(blah........


Walking the Earth like Kane

Plankity
Nervous Wreck (II) Inmate

From: us
Insane since: Apr 2001

posted posted 04-26-2001 21:39

OK... so I named the five links 'win1', 'win2', and so on. This made each work with it's own attributes.

Then I realized I might windup with all 5 plus the parent page opened which would be messy so I renamed the popups all to 'win' and began each onClick= with
win.close();
then continued with the
win = window.open(blah, blah...

There's no way of knowing which link will get clicked first and with all five links expressed the same, I get errors ('win' is undefined).

I can tell I'm on the right track -- the question is: Is there some way to create a 'win' that is defined in the head or some other transparent manner? I'm hoping I won't need to open the page with one link also opening as it's own popup (thereby defining 'win')

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 04-27-2001 23:21

easy enough

if (win) win.close();


Walking the Earth like Kane

Plankity
Nervous Wreck (II) Inmate

From: us
Insane since: Apr 2001

posted posted 04-28-2001 02:05

****! Thanks to all!

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 04-28-2001 02:41

Lol, the censoring put to good use. =)

Plankity
Nervous Wreck (II) Inmate

From: us
Insane since: Apr 2001

posted posted 04-28-2001 02:48

Yes, but at least I know what one of them is now, Slime!

Plankity
Nervous Wreck (II) Inmate

From: us
Insane since: Apr 2001

posted posted 05-01-2001 16:25

Well, I tried putting all the tags in and I still get errors!

Here's the offensive page:
Reviews of Irene Hardwicke Olivieri

WARNING: painting on base page contains some nudity!

Thanks to anyone who can provide any assistance!

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 05-01-2001 18:07

hokay.

One thing. Once you start using JS a bit more you'll learn that putting everything in the event handlers (onCLick, onmouseover etc..) is a bit of a pain and makes debugging really more trouble than it needs to be.

I'd recommend putting everything in the head as a function.

like so

<head>
<script>
// we set this at the beginning to false.
win = false;

function windowPopper(url, width, height){
// first lets close any open windows.
if (win) win.close();

// Now we are going to make our window properties. Assuming the only thing changing is the height and width. So thats what we are passing in
props = "width=" +width+ ",height=" +height+ ", Toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=no"

// Now open the window
win = window.open (url, 'win', props);
}
</script>


</head>
<body>

Then in your body you use this to open the window (actual example)
<a href="#" onClick="windowPopper('test/artext.html','400','480')">
<font color="#336600">
<br>
</font><font face="Times New Roman,Georgia,Times">
Barry Schwabsky <font size="3">--Art &amp; Text
</font>
</font> <font face="Times New Roman,Georgia,Times" size="3"><br>
</font>
</a>


Walking the Earth like Kane

Plankity
Nervous Wreck (II) Inmate

From: us
Insane since: Apr 2001

posted posted 05-01-2001 19:21

Bitdamaged: Great!

(Sheepish aside) Yes this code is hacked to death: this is a revamp of a site the artist was very disappointed with: I don't know what the original web dev guy used, but I'm just trying to revamp it (with the artist watching my every move)... maybe when we launch, I'll post something to that effect here.

Many thanks: where would a Photoshop guy go to get a better handle on this stuff? Any book recommendations?

Plankity

Plankity
Nervous Wreck (II) Inmate

From: us
Insane since: Apr 2001

posted posted 06-29-2001 18:56

YOW!

Now that I'v posted the page, Mac users are reporting problems accessing the pop ups! What did I do wrong?

www.irenehardwickeolivieri.com/reviews/

HELP!!!

regards,
--plankity

Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 06-29-2001 21:46

On the Robert Costa -- Cover link, I am getting both a horizontal and vertical scroller, but only for a few pixels. You might want to make that window a tad bigger to kill those off. On the New York Arts Magazine link, I am getting a horizontal scoller for about two pixels. It's probably just me, but I'd turn the menubar off as well.

I can't help with the Mac stuff. Sorry - just thought I would toss in my .02

Plankity
Nervous Wreck (II) Inmate

From: us
Insane since: Apr 2001

posted posted 06-29-2001 21:54

thanks!

I guess the problem seems to be mainly with AOL/MSIE Mac users.

At least that what I heard so far.

regards,
--plankity

Jeni
Paranoid (IV) Mad Scientist

From: 8675309
Insane since: Jul 2000

posted posted 06-29-2001 21:58

I'm on a mac. IE 5.0. The first time I load the page if I click on the first one, it comes up. If I close it and click on another, nothing happens. If I don't close it and just go click on another it just shows me the first one again. If I reload the site and click one of the others first it opens a new window and shuts it immediately. I couldn't help you with the coding part, but I thought the details of what was happening might help you out a little.

Plankity
Nervous Wreck (II) Inmate

From: us
Insane since: Apr 2001

posted posted 06-30-2001 14:21

Thanks for those details: I'm still at a loss though! I thought the web was an even playing field between Macs and PCs where everyone could play nice!

regards,
--plankity

Plankity
Nervous Wreck (II) Inmate

From: us
Insane since: Apr 2001

posted posted 07-01-2001 18:41

Well, I added a browser check script that I found: I will check with my Mac flovered contingent...

thanks to all (I may be back). Jeni, if you get a chance maybe give it another look.

Thanks again.

regards,
--plankity

Jeni
Paranoid (IV) Mad Scientist

From: 8675309
Insane since: Jul 2000

posted posted 07-02-2001 14:05

Hmmm. Sorry, same thing

Plankity
Nervous Wreck (II) Inmate

From: us
Insane since: Apr 2001

posted posted 07-10-2001 14:42

I think it might now work but won't know until some friendly mac users go and look...

Irene Hardwicke Olivieri

various reviews should open in popup window: window is dismissed by next 'review-view'

regards,
--plankity

« BackwardsOnwards »

Show Forum Drop Down Menu