1
我是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,這將會更容易和簡單。 –
你爲什麼又問這個問題?我在另一個回答。 –