Example 1: Native Tooltips

The first example demonstrates the most fundamental use of the tooltip library, as a replacement for native tooltips. In this example, we see how closely a DOM Tooltip can match the functionality of native browser tooltips. There are two links below. The link on the left uses the title attribute, which is interpreted by the browser as a tooltip command. The link on the right uses the DOM Tooltip library to generate the same tooltip.* The tooltip will even disappear after a 5 second delay, approximately the same delay the browser uses for its tooltips.**

It is not necessary to specify the width of the tooltip. The tooltip will expand to the available space if no width is specified.

Native Tooltip | DOM Tooltip

* If you are using Opera 7, you may have a native tooltip popping up on the right link. It is necessary to navigate to your preferences and turn off tooltips (Preferences > Window > Show Tooltips).

** In Opera 7, the native tooltip says until you mouseout.

Note: The benefit which the DOM Tooltip has over the native tooltip is developer control. The DOM Tooltip settings allow you to modify how long before the tip shows up, the colors used, and a host of other options. Native tooltips are hard to rely on. Sometimes they just don't show up, in different browsers they have different colors and, if you hold your mouse still long enough, they eventually disappear while the mouse is still over the link.

«TOC
Example 2»