Painless tooltip plugin using CSS3 features to make its usage as simple as possible.
Current version: 1.0 Stable
Demonstration
-
Default
hover meShow usage -
Click event
click meShow usage -
Custom position and animation
hover meShow usage
Basic Usage
Basic HTML
<span class="tip" title="tooltip content">
some text
</span>
Basic CSS
.minitip-content {
font-size: 11px;
padding: 8px 10px;
color: #fff;
background-color: #3C3C3C;
border: 1px solid rgba(255, 255, 255, 0.25);
text-shadow: 0 0 2px #000;
box-shadow: 0 0 3px #555;
border-radius: 5px;
}
Basic Initialization
$(function() {
$('.tip').miniTip();
});
Options
-
position (string)
Tooltip position. Can be 'bottom', 'top', 'left' or 'right'.
Default value is 'top' Show example -
event (string)
Event type triggering the tooltip to be displayed. Values can be 'hover' or 'click'.
Default value is 'hover' Show example -
offset (integer)
Distance between the element and the tooltip (in pixels).
Default value is 10 Show example -
delay (integer)
Time before the tooltip appears on hover event - How long it stays visible for on click event.
Default value is 200 Show example -
showArrow (boolean)
Show tooltip arrow.
Default value is true Show example -
contentType (string)
Tooltip content type. Can be an element attribute or a DOM selector. Possible values are 'attribute' or 'selector'.
Default value is 'attribute' Show example -
contentAttribute (string)
Attribute name if content type is 'attribute'.
Default value is 'title' Show example -
contentSelector (string)
Selector if content type is 'selector'.
Default value is an empty string Show example -
showSpeed (integer)
Animation speed in milliseconds on show.
Default value is 350 Show example -
hideSpeed (integer)
Animation speed in milliseconds on hide.
Default value is 250 Show example -
showEasing (string)
Easing equation on show.
Default value is an empty string Show example -
hideEasing (string)
Easing equation on hide.
Default value is an empty string Show example -
className (string)
CSS class name added on the tooltip which can be useful for themes.
Default value is an empty string Show example -
showAnimateProperties (object)
Animate properties on show, will fadeIn by default.
Default value is an empty object {} Show example -
hideAnimateProperties (object)
Animate properties on hide, will fadeOut by default.
Default value is an empty object {} Show example -
onHidden (function)
Called when the tooltip is hidden.
Default value is empty Show example -
onHide (function)
Called when the tooltip is hiding.
Default value is empty Show example -
onVisible (function)
Called when the tooltip is loaded.
Default value is empty Show example -
onLoad (function)
Called when the tooltip is being loaded.
Default value is empty Show example
Connect
About
Matthieu Aussaguel
I am a Web Developer currently working at Envato as part of the Marketplace dev team in Melbourne, Australia. I focus mostly on Ruby/Rails technologies but I also enjoy coding in CoffeeScript in my spare time. Head over to my personal website and my Github page for more info about me.
Follow @mattaussaguel