Dynamic Tooltips: Final Thoughts - Doc JavaScript
A Final Word
I was working on my computer two weeks ago, when I noticed how much tooltips help me get my work done. Windows applications are loaded with tooltips, so I came up with two main questions:
- Why do all the tooltips have the same font and background color? Why don't they feature any graphic elements?
- Why do I rarely see tooltips on web pages? Why don't links support tooltips on both browsers?
This column answered these questions. We presented a script that creates dynamic, full-featured tooltips for standard hypertext links. You can add tooltips to provide additional information about your links.
Like always, we focused on a backward-compatible, cross-browser solution. Our tooltips work on both fourth-generation browsers, on all platforms. They are also compatible with older browsers, because they don't affect them. In other words, this is a win-win script. In this column you learned:
- How to construct a tooltip with HTML.
- How to define a stylesheet for each tooltip on the page.
- How to associate a tooltip with a specific link via its event handlers.
- How to find out when the tooltip should be displayed.
- How to display a tooltip when required.
- How to clear a tooltip when the user removes the pointer from the link.
- How to associate a tooltip with multiple links that share the same URL.
For your reference, you may view the code for the first and second versions of the script.
Created: March 26, 1998
Revised: March 26, 1998
URL: https://www.webreference.com/js/column16/final.html