Download v1.0.1

Tooltip plugin for jQuery

Welcome to the homepage for this plugin! As you can see there are little what boxes kind of everywhere. Well, this is the script in action! Now, this script is released under the GPL, but all that info is in the archive that you download. But, onto the script! First off, some examples.

Basic Example

This is the most obvious use of the script. Get element(s) and add a tooltip.

Rollover
Rollover for some text!

Documentation

Now, so you understand how to use it, I ofcourse need to explain the script to you. The full function is:

$('filter').addTooltip({
        text: "Text here!!!",
        width: 200,
        side: 'top',
        imgdir: './images',
        removeOn: null,
        useArrow: true
}

Now, to break it down...

text
String - Enter the text (Or HTML) you want to display in the box.
width
Integer - Set the width of the box.
side
String - The side you want it to be on. Should be bottom, top, left or right
imgdir
String - Where should the script try and grab the image from? Note: A line in the CSS must also be updated!
removeOn
String|Integer - If its a number, it will wait that many milliseconds then remove it. Else use a known event (Ex: 'click') in its place, or nothing/null.
useArrow
Boolean - Show the arrow or not
useArrow
Boolean - Show the arrow or not

Now, there is the exact div.

$.addTooltip({
        text: "Text here!!!",
        width: 200,
        imgdir: './images',
        removeOn: null,
        position: {x: 0, y: 0}
}

Now, there is one more attribute that makes this one special

position
Array - Set the x and y of where the element will appear.

Versioning

1.0.2
Positioning error with { side: 'left' } fixed, and switch around two lines (Referencing var before declaration).
1.0.1
Fixed graphical error with XHTML Traditional.
1.0
Inital Release.

Bugs and Errors!

Because I am not perfect, bugs do exist in this code. Now, to make this IE6 compatible, I removed the ability for XHTML Strict. Thats not really a bug, but a fix would be nice!

[Fixed] Improper render w/ XHTML Traditional
The error is with the HTML code of the table and sizes and all that fun stuff. Maybe a some div HTML would fix it? Though that errors in IE6/7 >.

Any other bugs just email me!

DudeAmI.com