Main Page | Modules | Directories | File List | File Members

tooltips.js File Reference

Go to the source code of this file.

Variables

Zapatec Tooltip
Zapatec Tooltip setupFromDFN
Zapatec Tooltip prefs
 Global Tooltips preferences:.
Zapatec Tooltip _C = null
Zapatec Tooltip prototype _onMouseMove
Zapatec Tooltip prototype _onMouseOut
Zapatec Tooltip prototype show
Zapatec Tooltip prototype hide


Variable Documentation

Zapatec Tooltip
 

The Tooltip Object constructor (call it with new). This function links a tooltip element which can be anywhere in the DOM tree to some target element. Then, when the end-user hovers the target element, the tooltip will appear near the mouse position.

Parameters:
target [HTMLElement or string] reference to or ID of the target element
tooltip [HTMLElement or string] reference to or ID of the tooltip element
Returns:
a new Tooltip object if called with "new Zapatec.Tooltip()"

Definition at line 25 of file tooltips.js.

Zapatec Tooltip setupFromDFN
  Automagically create tooltips from DFN tags. The HTML syntax is simple:

   <dfn title="Tooltip title">
      Tooltip contents
   </dfn>

Calling this function once when the document has finished loading (body.onload) will turn all DFN tags into tooltips. Nice, eh?

The optional "class_re" parameter allows one to filter elements by some class name. It can be a RegExp object or a string; if it's a string, only DFN-s containing that string in the value of the "class" attribute will be considered. If it's a RegExp, only those DFN-s where the value of the class attribute matches the RegExp will be considered.

The DFN tag is a standard HTML element. It's purpose is to markup a definition, which seems fairly close to the purpose of a tooltip.

Parameters:
class_re [string or RegExp, optional] -- filter the DFN elements that display tooltip

Definition at line 94 of file tooltips.js.

Zapatec Tooltip prefs
  Global Tooltips preferences:.

Definition at line 117 of file tooltips.js.

Zapatec Tooltip _C = null
 

[internal] keeps a reference to the currently displayed tooltip

Definition at line 120 of file tooltips.js.

Zapatec Tooltip prototype _onMouseMove
  Called automatically when "onmouseover" or "onmousemove" occurs on the target element. This function takes care to display the tooltip, if not already visible, and to clear the timeout if the tooltip was set to hide.

Parameters:
ev [Event] the event object

Definition at line 129 of file tooltips.js.

Zapatec Tooltip prototype _onMouseOut
  Called automatically when "onmouseout" occurs on the target element. This function sets a timeout that will hide the tooltip in 150 milliseconds. This timeout can be cancelled if during this time the mouse returns to the target element or enters the tooltip element.

Parameters:
ev [Event] the event object.

Definition at line 151 of file tooltips.js.

Zapatec Tooltip prototype show
  Show the tooltip at a specified position.

Parameters:
x [number] the X coordinate
y [number] the Y coordinate

Definition at line 171 of file tooltips.js.

Zapatec Tooltip prototype hide
  Hides the tooltip.

Definition at line 195 of file tooltips.js.