Link Box

v1.0 - Feb 19, 2005
linkbox.zip (7k)


Link Box is a Dynamic HTML script that opens an information box when the mouse runs over a hyperlink. The Link Box pops up near the cursor position and can be used to display extra information about a link. Link Box is very easy to install and has the ability to change appearances dynamically.

   Features:

  • Simple installation.
  • Fully customizable.
  • Dynamically change appearances.
  • Automatic loading.
  • Optional drop shadow effect.
  • Runs in all DHTML compatible browsers (including 4th generation).

* This script requires the Dynamic HTML scripting library dynLib. For more information about dynLib please visit the dynLib website.

Demonstration

Run your mouse over the following links and see different examples of the Link Box appear:

Installation

1. Upload the files dynlib.js & linkbox.js then link them to your document as JavaScript include files. Add the following code between the <head> & </head> tags:

<script language="JavaScript" src="dynlib.js"></script>
<script language="JavaScript" src="linkbox.js"></script>

2. Call the openLinkBox() function using a hyperlink with the onmouseover event handler and the closeLinkBox() function using the onmouseout event handler. Add the following code within the body of your document:

<a href="myfile.html"
onmouseover="javascript:openLinkBox('My Message');"
onmouseout="javascript:closeLinkBox();">My Text</a>

Documentation

Function: openLinkBox()
Description: This function shows the Linkbox. It uses a number of arguments that specify the Link Box features. The first argument is the most important one, it specifies the message to be displayed in the Link Box. This message can be plain text or HTML. All of the remaining arguments specify other features about the Link Box and are optional with default settings defined in the configuration section of the file linkbox.js.

openLinkBox(MESSAGE,BGCOLOR,BORDERCOLOR,BORDERWIDTH,FONTCOLOR,FONTFACE,
FONTSIZE, BOXWIDTH,BOXPADDING,SHADOWVISIBLE,SHADOWCOLOR,TRACKMOUSE)

MESSAGE A string that specifies the message within the box. This can plain text or HTML.
BGCOLOR An optional string that specifies the background color.
BORDERCOLOR An optional string that specifies the border color.
BORDERWIDTH An optional number that specifies the border width.
FONTCOLOR An optional string that specifies the font color.
FONTFACE An optional string that specifies the font face or type.
FONTSIZE An optional string that specifies the font size.
BOXWIDTH An optional number that specifies the box width.
BOXPADDING An optional number that specifies the box padding.
SHADOWVISIBLE An optional boolean that specifies the drop shadow visibility.
SHADOWCOLOR An optional string that specifies the drop shadow color.
TRACKMOUSE An optional boolean that specifies the mouse tracking. If this is set to true the box will follow the mouse. If this is set to false the box will remain stationary after it has opened.

Function: closeLinkBox()
Description: This function hides the Linkbox. This function has no arguments.

closeLinkBox()

Source Code

  linkbox.js (6k)

Notes

  • With some modifications to this script you could change the position of the box to popup to the left of the cursor or set it to a fixed position within the window.

Link Box by Lloyd Hassell

Website: lloydhassell.brinkster.net
Email: lloydhassell@hotmail.com