Ruby, Rails, Firefox, Anime, Mac
In: Web development28 Nov 2003
Dunstan wrote up on an improved Nice Titles script in his beautiful and very interesting blog. What are Nice Titles you say? They are the brainchild of Stuart Langridge and appear on this site when you hover over a hyperlink with the title attribute set. If you’re using Mozilla or Mozilla Firebird, the CSS takes advantage of the -moz-opacity to give the popup div some transparency, and -moz-border-radius for rounded corners (other browsers will render an opaque rectangle).
Why Nice Titles? Firstly, they are kinda cool. And I like the way the URL is displayed in the popup div. Control over the delay between mouseovers and the div popping up helps to have title dialogs show up faster (or slower) than the browser default – I personally find the delay a little too long for “standard” titles.
All this is done using purely DOM methods (DOM is a W3C standard) and will work in all correctly-implemented DOM-compliant browsers. Of course, this method degrades gracefully in the face of text browsers, limited browsers in mobile devices, screen readers, etc. Want it for your site? It’s as easy as uploading the CSS and JS files to your webserver and linking to them. Any existing titles will magically become a Nice Title.