
#tooltip {
position: absolute;
float: left;
max-width: 250px;
background: rgba(0, 0, 0, 0.8);
padding: 15px;
color: #fff;
font-style: italic;
font-size: 14px;
transition: opacity 0.1s;
text-align: left;
opacity: 0;
}
$(function() {
var toolTips = window.toolTips = {
timeout: null,
html: '<div id="tooltip"></div>',
init: function() {
$(toolTips.html).appendTo('body');
},
show: function() {
$('#tooltip').css({
opacity: 0
});
clearTimeout(toolTips.timeout);
$('#tooltip').html($(this).data('tip').replace('\n', '<br/>'));
var offset = $(this).offset(),
height = $(this).outerHeight() + 15,
parWidth = $(this).outerWidth() / 2,
width = (($('#tooltip').outerWidth()) / 2) - parWidth;
$('[data-tip]').bind('mousemove', function (e) {
$('#tooltip').css({
left: e.pageX + 35,
top: e.pageY,
opacity: 1
});
});
},
hide: function() {
$('[data-tip]').unbind('mousemove');
toolTips.timeout = setTimeout(function() {
$('#tooltip').css({
opacity: 0
});
}, 50);
}
}
toolTips.init();
$(document).on("mouseenter", ".item[data-tip]:not([data-tip*='empty slot'])", toolTips.show);
$(document).on("mouseleave", ".item[data-tip]", toolTips.hide);
});
<script type="application/javascript" src="lib/mule.js"></script> <script type="application/javascript" src="lib/muledump.js"></script> <link type="text/css" rel="stylesheet" href="lib/dump.css"> <link type="image/png" rel="shortcut icon" href="lib/favicon.png">
<script type="application/javascript" src="lib/mule.js"></script> <script type="application/javascript" src="lib/muledump.js"></script> <script type="application/javascript" src="lib/tooltips.js"></script> <link type="text/css" rel="stylesheet" href="lib/dump.css"> <link type="text/css" rel="stylesheet" href="lib/tooltip.css"> <link type="image/png" rel="shortcut icon" href="lib/favicon.png">
var title = it[0];
if (~it[2] && it[1] != 10 && it[1] != 9) title += ' (T' + it[2] + ')';
if (it[6]) title += '\nFeed Power: ' + it[6]
return $r.attr('title', title)
.css('background-position', '-' + it[3] + 'px -' + it[4] + 'px')
var title = it[0];
if (~it[2] && it[1] != 10 && it[1] != 9) title += ' (T' + it[2] + ')';
if (it[6]) title += '\nFeed Power: ' + it[6]
return $r.attr('data-tip', title)
.css('background-position', '-' + it[3] + 'px -' + it[4] + 'px')


