# Open new window -> re-use open window?



## MDLarson (Sep 10, 2003)

Hey folks, and thanks for making this a good sounding board for site suggestions.  

Follow this link and then click on any of the testing applications for examples.

*Current Setup*
Each testing application has a glossary of terms at the bottom of the page.  When clicking on these terms, a new window pops up and attempts to move the term's definition to the top of the page (using named anchors).  Clicking on multiple terms would spawn multiple new windows.

*Desired Setup*
I would like to popup _one_ "Glossary" window and simply scroll up and down in this Glossary window whenever a term is click in the first window.  An added bonus would be term selection, like highlight the definition text in green or yellow or something.

Any ideas?  I'm pretty sure this can be done, maybe with named windows and CSS or something.


----------



## Arden (Sep 10, 2003)

*target="LSI Glossary"* perhaps.


----------



## uoba (Sep 11, 2003)

Funny, I found exactly the CSS you need  whilst browsing yesterday (for the highlighting of the target that is)... check out my example here: http://c-o2.net/cssTests/index.html

The hint is for this link: http://devedge.netscape.com/viewsource/2003/target-selector/

As for the targetting window, I gather you mean you only want one window to pop up, and be used, rather than separate windows opening on every glossary click? I'd have to do a test run with this, but haven't got time sorry (it's my first day off in months, so family are calling! Maybe tonight  )


----------



## MDLarson (Sep 11, 2003)

The latest and greatest...

I figured out the target thing.  My window is now named "glossary".

I'm currently trying out a combination of things:
First, I use the OnMouseDown event to Open Browser Window (pretties up the glossary page)

Then, in basically the same action (OnClick) regular HTML targets "glossary" and the link points to the term on the already opened glossary window.

This works well enough in Mac IE 5, but Windows IE 6 behaviour sucks*.  Try it out in your browser and let me know what you think.

*IE 6 - the first time a term is clicked, a new browser window pops up, but does not go to the term defnition.  Leaving this window open, and clicking on subsequent terms succeeds in jumping to the correct definition, but the window remains *behind* the main one, forcing the user to click on the glossary window in the taskbar to realize that something actually happened...


----------



## Arden (Sep 12, 2003)

There are scripts to bring a window to the forefront; I'm sure you've seen this in reverse, unless you have popups squelched in Safari.  Try searching for this on your favorite Net coding sites or checking out the source code of various popups.

Uoba, I'm not quite sure what you're trying to demonstrate... your test page did nothing for me, and I'm not quite sure what you're getting at anyway.


----------



## uoba (Sep 12, 2003)

Just showing the highlighting effect on anchored/targeted jumps within a document (I didn't put the targets in another doc, or move them down the page, which would've made it more obvious).

It was something I had done the night previous to Larson's post, so thought I would share


----------



## MDLarson (Sep 12, 2003)

> _Originally posted by uoba _
> *Just showing the highlighting effect on anchored/targeted jumps within a document (I didn't put the targets in another doc, or move them down the page, which would've made it more obvious).
> 
> It was something I had done the night previous to Larson's post, so thought I would share  *


I tried your page out as well, uoba, and I didn't see anything special in IE 5 for Mac.  Sitting here at home, eating my bowl of Cheerios for breakfast, and trying it out in Safari however, it works like a charm!

I'll look into it more at work.


----------



## uoba (Sep 12, 2003)

Hmmm, should've mentioned... I think the css ':target' attribute is CSS2. Thus, may not be supported in all browsers (but in true standards form, if it doesn't work, it won't be broken).


----------



## MDLarson (Sep 12, 2003)

> _Originally posted by arden _
> *There are scripts to bring a window to the forefront; I'm sure you've seen this in reverse, unless you have popups squelched in Safari.  Try searching for this on your favorite Net coding sites or checking out the source code of various popups.*


OK, Javascript is obviously not my native language.  I've tried searching sites like www.javascript.com, www.javascriptcentral.com, www.cgiscripts.com, etc.  But I can't seem to find anything that gives me what I want.  Basically a script that brings the glossary window to the front when it's clicked.  Can somebody provide me with a line of code that will make it work?  I'm guessing it has something to do with the OnFocus command... but not sure.


----------



## Arden (Sep 12, 2003)

Try focusing the window as soon as it loads, so "onLoad=focus;" possibly with ()'s.


----------

