Late night jQuery play

May 12, 2008 – 3:52 am

A few days ago Alen shared a easy way to do powerful tooltips using a few lines of jQuery.

A commenter suggested that the scripts be wrapped in a jQuery plugin, and as I’m at the moment trying to learn more about the process of writing plugins, I thought that’d be a great excercise, and maybe even prove useful for someone.

So, here it is jQuery CSS Tooltip script based on Alen’s work. To try it out, grab the original examples, include jquery.csstooltip.js instead of main.js and copy/paste the examples provided in the plugin source code comments.

I’ve abstracted the code a bit, so you can provide a function which creates any kind of HTML to be put in the tooltip (just remember that the tooltip is a paragraph).

Post a Comment