RE: pop-up glossary

by "Jones, Sharon" <sjones05(at)harris.com>

 Date:  Tue, 26 May 1998 07:44:36 -0400
 To:  "'Steve Bassler'" <bassmstr(at)westol.com>,
HWG Graphics <hwg-graphics(at)hwg.org>
  todo: View Thread, Original
The only problem I see with this idea is folks with IE can't view the pop-up.
Depending on your audience, you need to make sure everyone can get the info.

Sharon Jones
Web Site Designer
Harris Corporation
*email:  sjones05(at)harris.com)


	-----Original Message-----
	From:	Steve Bassler [SMTP:bassmstr(at)westol.com]
	Sent:	Friday, May 22, 1998 12:16 PM
	To:	HWG Graphics
	Subject:	Re: pop-up glossary

	Brian D. Graham wrote:
	> 
	> Curse my faulty memory.  I recall vaguely reading (or perhaps viewing)
	> somewhere that is was possible to have a page with hyperlinked words
	> which, when clicked on, brought up a sub-page with a definition
instead
	> of a new browser page.  Does that make sense?  I can't remember what
	> language this entails, but I would appreciate any help.  I've tried
	> searches, but how do you describe what I'm looking for?      :{

	You can set up a Javascript function to do this:

	<HEAD> ...
	<SCRIPT LANGUAGE="JavaScript">
	<!-- Enable cloaking device
	function define(word, height) {window.open('definitions.html#' + word,
	'','toolbar=no,scrollbars=yes,resizable=no,width=300,height=' +
	height)};
	// Disable cloaking device -->
	</SCRIPT>
	</HEAD>

	<BODY> ...
	Here we define this <A HREF="javascript:define('term',250)">term</A>.
	</BODY>

	In definitions.html you'll need to set up named anchors for each
	definition, with enough <BR> tags between them so that when the window
	opens, it looks like the selected definition is the only one there.  In
	this case, we're defining the word "term" using an anchor name of "term"
	in the HTML.  Because various definitions will be of different lengths,
	I include a height parameter to size the window accordingly.  (I use
	scrollbars=yes because someone might be using an extra-large font and
	they will need to scroll to see it all.)  You could easily expand this
	to use a width parameter as well if you like.  Set the background color
	of definitions.html to something other than the color of the original
	document so it shows up well when it opens.

	In addition, I place this in the BODY tag of definitions.html:
	  onBlur="self.focus();"
	so the new window stays on top, and include with each definition:
	  <FORM><CENTER>
	  <INPUT TYPE="button" VALUE=" Close " onClick="window.close()">
	  </CENTER></FORM>
	so the user can see easily how to close the window.

	It's a hack, but it works.  Actually, what I use it for is footnotes for
	magazine articles, so this is a slightly modified version for your
	situation.  I used to link each superscripted number to a named anchor
	in the same HTML file, but someone commented to me that not everybody
	would know how to use their browser's "Back" button to return to the
	article, so I came up with this instead.

	Hope it works for you.
	Steve
	_________________________________________________________
	Steve Bassler, bassmstr(at)westol.com, WebServant(at)pdinet.org
	Visit my home page at http://www.westol.com/~bassmstr
	or the PDI Web site at http://www.pdinet.org

	If I stand, let me stand on the promise that You will pull me through,
	And if I can't, let me fall on the grace that first brought me to You.
	If I sing, let me sing for the joy that has borne in me these songs,
	But if I weep, let it be as a man who is longing for his home.
	                                    - Rich Mullins,  1955-1997

HWG: hwg-graphics mailing list archives, maintained by Web Professional Association - IWA

This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.