【发布时间】:2011-05-08 04:42:43
【问题描述】:
我有一张桌子。在每个表格中,当有人将鼠标悬停在 TR 上时,我希望它通过 qtip 显示工具提示。
这是我的 jquery 代码:
$('.contacttr').qtip({
content: {
text: $(this).find('.contactinfo')
},
position: {
my: 'bottom center',
at: 'center',
target: $(this).find('.contactname')
}
})
这是我的html:
<tr class="contacttr">
<td class="contactname"><div class="contactinfo">info goes here</div>Persons Name</td>
<td>joe@gmail.com</td>
<td>123 fake street</td>
</tr>
<tr class="contacttr">
<td class="contactname"><div class="contactinfo">info goes here</div>Persons Name</td>
<td>joe@gmail.com</td>
<td>123 fake street</td>
</tr>
<tr class="contacttr">
<td class="contactname"><div class="contactinfo">info goes here</div>Persons Name</td>
<td>joe@gmail.com</td>
<td>123 fake street</td>
</tr>
问题是工具提示只显示在第一行,它显示了所有contactinfo div中的内容,而不仅仅是悬停在行中的内容。
【问题讨论】: