Poshy Tip jQuery Plugin

Usage Examples

The default browser tooltip that displays the value of the title attribute is replaced with a "poshier" version:

Hover for a tooltip

Styles (Classes)

Using different tooltip classes is easy. Here are some examples that are included in the download package (in the "src" folder).

.tip-yellow

$('#demo-tip-yellow').poshytip();

.tip-violet

.tip-darkgray

.tip-skyblue

.tip-yellowsimple (no background-image used for the tooltip body)

.tip-twitter (ala Twitter)

.tip-green

Form Tooltips (with varying positioning)

Adding form input field tooltips is simple. You just have to make sure they are triggered on focus/blur (i.e. showOn: 'focus') and positioned relatively to the target element (i.e. alignTo: 'target'). The script also updates the position of such tooltips if the window is resized (e.g. show some of the tips below and resize your browser window for a demo).





Asynchronous Loading of the 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. The script also recalculates and updates the position of the tooltip when its content is updated.

Simple Example

Update content after 1 second

Loading Flickr Feeds

A more complicated example of loading some Flickr images by tags:

flowers, closeup, sunset, architecture, Plovdiv, old, town, Nesebar, depeche

Following the Mouse Cursor

If using the followCursor: true option, it's better to make sure the the slide animation effect is disabled (i.e. slide: false) so that it doesn't conflict with the code that moves the tooltip with the cursor.

Hover for a tooltip that follows the cursor

API Example - Triggering the Tooltip Manually

If you like, you can add a tooltip to some element(s) and configure it to not be triggered automatically on hover or focus/blur by using the showOn: 'none' option. You can then control the tooltip manually via the available methods.

This link has a tooltip that is not triggered automatically

Using Live Events

You can set the liveEvents: true option to use live events. Note that the API methods (except 'destroy') won't work reliably in such case. They will only work for the elements for which the tooltip has been initialized (i.e. shown at least once). Live events are supported in jQuery 1.4.2+.