|
Script Summary:
For anchors or images with no title, copy appropriate text to title, splitting as necessary |
this script has 1 topic, 2 posts |
This script has no reviews. |
For all images with an alt= and no title=, copy the alt text to the title text, to make it visible as a tooltip.
For all anchors with an href= and no title, copy the href text to the title text.
In all cases, if the text for the title is too long to fit into the tooltip (roughly 70 chars with the default tooltip typeface and size), split the text into multiple sections, displaying successive sections on successive mouseovers.
When Firefox bug 67127 (https://bugzilla.mozilla.org/show_bug.cgi?id=67127) is fixed, we can display the entire text in one tooltip on multiple lines.
Notes
* Separating the tooltip text into separate sections works by counting each mouseover and setting the tag's title= text to the appropriate section.
* Thus, on the first mouseover for a multiple section tooltip, the title is set to the first section. On the second mouseover, the title is set to the second section, etc.
* However, not all mouseovers result in a tooltip (e.g. the mouse is moved away from the image/link before the tooltip displays). Thus, you might not see the section you next expect on any one particular tooltip display if you've been swatting flies with your mouse.
* If an image is surrounded by an anchor and the image has a non-empty title or alt attribute, then the mouseover event of the image triggers, not the one for the anchor.
* Links defined within scripts (such as Google ads) are not covered by this technique.
* Recoded for compatibility with Firefox 1.5 and GM 0.6.4





