Sweet Titles

Here’s a clean way to create CSS’ed tooltips. Very nicely done. The even fade. I’m using them at work. This was a great idea but I would had thought of it sooner or later if I hadn’t found this today.

Basically, all you need to do is set the title attribute of an href. This script crawls across the page onload and assigns show/hide div dunctions to the onmouseover/onmouseout attributes of an href then removes the title attribue so the default browse tooltip doesn’t pop up when this CSS’ed version is up. It works on ‘a’s,’abbr’s and ‘acronym’s. Don’t worry, this doesn’t hijck your onload, it finds your onload and concats it’s startup function to it.

I was looking to hack/addon some scripts that read the dynamic Struts validation functions to initalize validation of a fields onblur. Same concept as to how Sweet Titles works.

I had to hack Sweet Titles little to not show a tooltip if title was null or empty. Plus I set the em’s display style to none, to not show the link in the tooltip.

Check this out, it might be useful. If not, it’s an easy way to add an extra feature to any project.

[url=http://www.dustindiaz.com/sweet-titles]click here for the website[/url]