Display a customized tooltip instead of the default one for every selected element.
The tooltip behaviour mimics the default one, but lets you style the tooltip and specify the delay before displaying it. In addition, it displays the href value, if it is available.
When used on a page with select elements, include the bgiframe plugin. It is used if present.
To style the tooltip, use these selectors in your stylesheet:
#tooltip - The tooltip container
#tooltip h3 - The tooltip title
#tooltip div.body - The tooltip body, shown when using showBody
#tooltip div.url - The tooltip url, shown when using showURL
The id #tooltip can be changed using the id option.Arguments:
| options (Optional) | Options | |
|---|---|---|
| A set of key/value pairs that configure the validate. All options are optional. | ||
Replaces the default tooltip of anchors with customized ones.
$("a").tooltip();
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<link rel="stylesheet" type="text/css" href="http://dev.jquery.com/view/trunk/plugins/tooltip/jquery.tooltip.css" />
<script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/tooltip/jquery.dimensions.js"></script>
<script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/tooltip/jquery.tooltip.js"></script>
<script>
$(document).ready(function(){
$("a").tooltip();
});
</script>
</head>
<body>
<a href="http://jquery.com" title="Write less, do more">jQuery.com</a>
<br/>
<a href="http://learningjquery.com" title="Learn more, write less">learningjQuery.com</a>
</body>
</html>
}}
