jquery tooltipster插件不能正常工作
问题描述:
我是jquery的新手,这个问题与jquery相比更加相关。任何帮助表示赞赏。jquery tooltipster插件不能正常工作
我使用Tooltipster Plugin创建工具提示,每次我将鼠标悬停在数据表中的<td>
元素上时。为此,我已将数据表中的每一行循环,然后使用子节点选择<td>
元素,并应用.tooltipster()函数。但是,工具提示仅适用于第1行<td>
元素。任何想法如何让它适用于所有行?
$('#mytable tbody tr').each(function(){
//childNode[7] is the <td> element on which i want the tooltip
$(this.childNodes[7]).tooltipster({
animation: 'fade',
delay: 200,
theme: 'tooltipster-punk',
trigger: 'hover',
interactive: 'true',
functionBefore : function drawChart() {
// This isnt needed to understand the problem so i have not pasted the code
}
});
});
表数据
<td class="tooltip" data-tooltip-content="#chart_div" style="padding-left:40px" id="storage" >
<img src="@Url.Content("~/Content/images/database.png")" />
</td>
如果你只需要一个小文本作为工具提示,那么使用“title”而不是tooltip,这将会更容易和简单。 –
你为什么又问这个问题?我在另一个回答。 –