This is a demo page for the clueTip Plugin — a jQuery-based, AJAX-powered tooltip developed by Karl Swedberg.
If you like this plugin and you're feeling generous, perhaps you'd also like to visit my amazon.com wish list?
Below are quite a few examples of how you can add a clueTip to your page, using a wide range of options. Keep in mind that there is nothing magical about the HTML markup. You can use any jQuery selector you want to attach your clueTips. For example, if you want to attach clueTips to all links with a class of "peanuts," you would simply write in your jQuery code: $('a.peanuts').cluetip();
.
<a class="title" href="#" title="This is the title|The first set of contents comes after the first delimiter in the title.|In this case, the delimiter is a pipe">
$('a.title').cluetip({splitTitle: '|'});
<a class="basic" href="ajax.htm" rel="ajax.htm">
$('a.basic').cluetip();
<a class="custom-width" href="ajax3.htm" rel="ajax3.htm">
$('a.custom-width').cluetip({width: '200px', showTitle: false});
h4
have clueTips positioned by the mouse.
<h4 title="Fancy Title!" id="ajax3.htm">Hover over me</h4>
$('h4').cluetip({attribute: 'id', hoverClass: 'highlight'});
<a id="sticky" href="ajax6.htm" rel="ajax6.htm">
$('#sticky').cluetip({sticky: true, closePosition: 'title'});
div
element and displays an arrow that points to the invoking element: hover for local
<a class="load-local" href="#loadme" rel="#loadme">
$('a.load-local').cluetip({local:true, cursor: 'pointer'});
href
is different from its rel
, so if you click it, you'll go to the linked page hover for cluetip, click to visit URL
<a href="http://www.learningjquery.com" title="about this link:" rel="ajax6.htm">
$('#examples a:eq(5)').cluetip({
hoverClass: 'highlight',
sticky: true,
closePosition: 'bottom',
closeText: '<img src="styles/cross.png" alt="" />'
truncate: 60
});
<a href="ajaxclick.htm" rel="ajax5.htm" title="active ingredients">
$('#clickme').cluetip({activation: 'click', width: 650});
<a class="jt" href="ajax6.htm" rel="ajax6.htm" title="jTip Style!">
$('a.jt:eq(0)').cluetip({
cluetipClass: 'jtip',
arrows: true,
dropShadow: false,
hoverIntent: false,
sticky: true,
mouseOutClose: true,
closePosition: 'title',
closeText: '<img src="cross.png" alt="close" />'
});
<a class="jt" href="ajax5.htm" rel="ajax5.htm">
$('a.jt:eq(1)').cluetip({cluetipClass: 'jtip', arrows: true, dropShadow: false, hoverIntent: false});
title
attribute of a span
tag: splitTitle clueTip
<span title="Split Title|This clueTip's contents were created directly from the title attribute|Nice for minimum info.">
$('span[@title]').css({borderBottom: '1px solid #900'}).cluetip({
splitTitle: '|',
arrows: true,
dropShadow: false,
cluetipClass: 'jtip'}
);
<a class="jt" href="ajax5.htm" rel="ajax5.htm">
$('a.jt:eq(2)').cluetip({
cluetipClass: 'jtip', arrows: true,
dropShadow: false,
height: '150px',
sticky: true,
positionBy: 'bottomTop'
});
<a class="jt" href="#" rel="p.localvisible">visible local content</a>
$('a.jt:eq(3)').cluetip({local: true, hideLocal: false});
and here is our visible local content!
<a class="jt" href="ajax5.htm" rel="ajax5.htm">
$('a.jt:eq(3)').cluetip({
cluetipClass: 'jtip', arrows: true,
dropShadow: false,
onActivate: function(e) {
var cb = $('#cb')[0];
return !cb || cb.checked;
}
});
<a href="ajax4.htm" title="|first line body|second line body">
$('ol.rounded a:eq(0)').cluetip({splitTitle: '|', dropShadow: false, cluetipClass: 'rounded', showTitle: false});
<a href="ajax4.htm" rel="ajax4.htm" title="mouse positioned">
$('ol.rounded a:eq(1)').cluetip({
cluetipClass: 'rounded',
dropShadow: false,
positionBy: 'mouse'
});
<a href="ajax4.htm" rel="ajax4.htm" title="bottom/top positioned">
$('ol.rounded a:eq(2)').cluetip({cluetipClass: 'rounded', dropShadow: false, positionBy: 'bottomTop', topOffset: 70});
<a href="ajax4.htm" rel="ajax4.htm" title="rounded corners">
$('ol.rounded a:eq(3)').cluetip({cluetipClass: 'rounded', dropShadow: false, sticky: true, ajaxCache: false, arrows: true});
<a href="ajax404.htm" rel="ajax404.htm">
$('ol.rounded a:eq(4)').cluetip({cluetipClass: 'rounded', dropShadow: false});
this is the local content to load when the 'local' parameter is set to true.