Create a .js file and paste this code in.
(function($) {
$.fn.tooltip = function(options) {
var
defaults = {
background: '#e3e3e3',
color: 'black',
rounded: false
},
settings = $.extend({}, defaults, options);
this.each(function() {
var $this = $(this);
var title = this.title;
if ($this.is('a') && $this.attr('title') != '') {
this.title = '';
$this.hover(function(e) {
// mouse over
$('<div id="tooltip" />')
.appendTo('body')
.text(title)
.hide()
.css({
backgroundColor: settings.background,
color: settings.color,
top: e.pageY + 10,
left: e.pageX + 20
})
.fadeIn(350);
if (settings.rounded) {
$('#tooltip').addClass('rounded');
}
}, function() {
// mouse out
$('#tooltip').remove();
});
}
$this.mousemove(function(e) {
$('#tooltip').css({
top: e.pageY + 10,
left: e.pageX + 20
});
});
});
// returns the jQuery object to allow for chainability.
return this;
}
})(jQuery);
This should go in your page;
<script src="../../Scripts/jQuery.tooltip.js" type="text/javascript"></script>
<style>
#tooltip {
background: url(../images/search.png) no-repeat 5px 50%;
border: 1px solid #BFBFBF;
float: left;
font-size: 12px;
max-width: 160px;
padding: 1em 1em 1em 3em;
position: absolute;
}
.rounded {
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
}
</style>
<script type="text/javascript">
$('.tooltip').tooltip();
</script>
This is the link that will give you a tooltip;
<a href="#" class="tooltip rounded" title="The other day, I bla bla with WordPress.">over the years</a>
Now, you can replace the <a>
with anything you want so long as you have the class "tooltip". Then you can place buttons etc inside it.
This isn't the whole solution but it should get you pretty close.