【发布时间】:2012-10-29 07:22:12
【问题描述】:
see in jsfiddle 在单元格的鼠标悬停时,我必须使用 jquery 在工具提示中显示名称
像这样 约翰 固定
<td class="csstdRed" valign="top"><span id=32>John</span></td>
【问题讨论】:
标签: jquery
see in jsfiddle 在单元格的鼠标悬停时,我必须使用 jquery 在工具提示中显示名称
像这样 约翰 固定
<td class="csstdRed" valign="top"><span id=32>John</span></td>
【问题讨论】:
标签: jquery
我已经编辑了您的 JFiddle 代码。这是我添加的内容
$('#tableAppointment td[title]')
.hover(function() {
showTooltip($(this));
}, function() {
hideTooltip();
})
;
function showTooltip($el) {
// insert code here to position your tooltip element (which i'll call $tip)
$tip.html($el.attr('title'));
}
function hideTooltip() {
$tip.hide();
}
然后在 td 中添加 Title
<td class="csstdRed" title="John Fixed" valign="top"><span id=32>John</span></td>
希望这会对您有所帮助。我从How to add a Tooltip to a "td" with jquery? 得到这个想法,我想这就是你想要的。
谢谢..
【讨论】: