Poshy Tip - jQuery Plugin for Stylish Tooltips
I almost hear you asking - why another jQuery tooltip plugin? Well, I actually never planned creating this plugin until I reached the final stages of designing this website and decided to add some pretty tooltips. So I started looking for a tooltip plugin that allows easily creating stylish tooltips and also includes the most useful features for such a script. However, I wasn't pleased with the results I found so I ended up writing a completely new plugin and am now making it available for all.
Demos
You might be eager to take a look at some examples so here is the demo page right away. And below you will find a short introduction.
Notable Features
OK, so apart from the awful name, is there anything interesting about this tooltip plugin?
A Single Background Image for Scalable Tooltips
Suppose you need to code a scalable tooltip that looks like this (i.e. a tooltip with auto width/height based on the content inside it):

The Usual Approach
To achieve this with most similar plugins out there you would need to slice the image into multiple separate images - for the corners of the box, for the sides, etc.:

The Poshy Tip Approach
But since the tooltips only work when JavaScript is enabled anyway, why not apply some JS magic which would make our life easier and save our server some additional requests? This is exactly what Poshy Tip was designed to do. With this plugin, you can create a scalable tooltip by just using a single background image for the tooltip body:

You need to create one big image for the tooltip body - e.g. something like 1024x768 pixels (which should be enough for anything you may want to display inside a tooltip in the browser viewport). You then have to set it as a background image for the tooltip container DIV in the most trivial way:
.tip-yellow {
...
background-image: url(tip-yellow.png);
}
Poshy Tip detects when a background image has been set for the tooltip container DIV and creates a scalable frame from it that wraps the inner contents of the tip. Finally, you just need to specify what should be the size of the background image frame around the inner content by setting the following option:
bgImageFrameSize: 10 // pixels
And the result:

You can, of course, tweak the margin/padding of the inner DIV if needed.
Advanced Positioning Options
With Poshy Tip you can position the tips relative to the mouse cursor or to the target element and align them in every possible way horizontally and vertically (note the alignTo, alignX and alignY options). In addition the script makes sure the tips are always displayed in the browser viewport and also automatically positions the arrow (if available) on the appropriate side of the tooltip body.
Asynchronous Loading of the Tooltip Content
Poshy Tip supports using a function for returning the tooltip content and the script also passes an update callback function as an argument to this function. By using this callback, you can easily update asynchronously the content of the tooltip after it has been displayed. You can see a quick example on the demo page.
Documentation
You can find usage examples and a list of the options and methods available on the demo page.
License
Like jQuery, Poshy Tip is dual licensed under the MIT and GPL licenses.
Git
The Poshy Tip source code is also available at GitHub:
git clone git://github.com/vadikom/poshytip.git









Very nice article. It's very nice tooltip popup plugin. Thx
Good post. That is one wonderful Poshy Tip Approach. CS3 works great on images. But also have to try those plug-ins.
@John Yoder: I believe I answered you in the forum. Please let me know if you still have any questions.
@otter: Was thinking about this at some point during the development process but actually I decided to not disable the title attribute on hover when the poshy tips are shown just onfocus (like on form elements). I am still not sure which is the better approach here.
@Nyro: Good point, this is due to the elements initially having
display:noneapplied. But I will investigate a possible fix when I get some time..sorry, the better question is: "how to do multiple instances of same style on one page"
i feel dumb asking this, but why are the styles id's instead of classes. Only one use for each on the page? Am i missing something?
incredibly slick and useful tooltip! I've used dozens and always feel like I'm settling. this looks like the best of the best! congratulations on the plugin, it's great!
Nice plugin. It could be great to add something for preloading the images.
Thank you! It has long been searching for something like
Looks nice, but the default title behavier of the browser should be disabled.
Mouseover on an input field show the title, then click on the input field show poshy tip.
@bartaz: Yep, these are good points. But as Michiel mentions, the image can be optimized and actually it might even be much smaller than 1024x768 in most cases if needed (at least in height usually).
Also I believe you'd agree that although CSS3 really allows much it's still not possible to cover all possible designs you could with an image.
BTW, the script doesn't limit the use of CSS3 features in any way.
You can see that some of the demos use border-radius and no background image (just an arrow).
It's very good !! Thank!
@bartaz: You do have a point there. However, a big image shouldn't be a big problem if you pick the right file format and make the image simple enough (e.g. no noisy background).
Although I too prefer CSS3 over images. But I still like this plugin alot!
Really like it! I'm sure I'll be using it somewhere, thanks!
I'm not sure if creating and downloading '1024x768 pixels' pixels image is such a good solution. That's a huge thing to load!
Most of the browsers nicely support CSS3 rounded corners, shadows, etc. Why not just forget about images?
Thanks guys!
Happy to hear you like it!
Some things are just perfect. This is one of them.
Many thanks for creating this. You are absolutely right - there were many tooltip plugins, but you nailed how it should be done.
Naaaaaaais!
Wonderful approach and great coding
really well done
We are about halfway through the year, and the technological world has
progressed by leaps and bounds already. So much so, that in their
effort to keep up with
Very slick. will have a play with this today. Many thanks