08.23.06
FancyTooltips Fix
FancyTooltips, base on Nice Titles, is a popular wordpress plug-in, which creates pretty and useful tooltips for “title” attribute, and <acronym> <abbr> <ins> <del> tags.
It’s a great script, but still has two nasty problem, I don’t have solution until last week.
First problem is, with Firefox 1.5+, for some reason it show double, even triple tooltips(picture). Actually someone already wrote an work around(go his site to see the effect). Just add following two lines in fancytooltips.css:
div.fancytooltip > p {display:none;}
div.fancytooltip > p:first-child {display:block}
It doesn’t solve the bug in program, just hide all node, and only show first node. However I don’t like it too much, since without the link footnote, FancyTooltips looks less fancy. I hope to select the second child also, but seems difficult–since firefox 1.5 doesn’t support too complicated CSS3 selectors like nth-child.
But then I see though it can’t do second-child, we can use last-child.
If we add an additional line:
div.fancytooltip > p {display:none;}
div.fancytooltip > p:first-child {display:block}
div.fancytooltip > p:last-child {display:block}
Now it works just fine, without changing the look of FancyTooltips.
But please note that “last-child” is still a CSS 3 selector. So the third line may not work on certain browser, and will have the same result as the original fix.(However I don’t worry too much since in IE and Firefox 1.5 it works fine. Even with unsupported browsers, it won’t break too much.Seems IE7 now have this problem.)
The second problem for FancyTooltips is, it doesn’t parse timezone part of datetime attribute of <ins> <del> tags, it always create the time as localtime, and it will be mostly wrong unless you live in the same timezone.
It will be great effort to parse all valid datetime formats, so I decided to be lazy. In wordpress, del and ins button will create datetime attribute in GMT, regardless you blog timezone setting, so we can just build datetime in GMT, everything will be fine.
Modifying the line
oDate = new Date(nYear, nMonth, nDay, nHours, nMinutes, nSeconds);
into
oDate = new Date(Date.UTC(nYear, nMonth, nDay, nHours, nMinutes, nSeconds));
will do the trick.
Now I can continue to use FancyTooltips happily
(You can apply the patch your self or just Download the modified FancyTooltips plug-in.)
Note: FancyTooltips is released in MIT license.

Priv’s Blog » FancyTooltips re-fix said,
02.13.07 at 2:26 pm
[...] the previous fix is not working well with IE7, I’ve come up with a new FancyTooltips [...]