1
我正在使用jQuery工具提示为Datatable显示动态内容。加载动态内容时,旧元素的工具提示在加载新内容后保留。 我已经看到完全相同的问题,但接受的答案似乎并没有在我的情况下工作。 下面的提示,我加入到整个文档Jquery工具提示在动态更改DataTable内容后保留
$(document).tooltip({
position: {
my: "center top",
at: "center bottom+10",
using: function(position, feedback) {
$(this).css(position);
$("<div>")
.addClass("arrow")
.addClass(feedback.vertical)
.addClass(feedback.horizontal)
.appendTo(this);
}
}
});
的使用更改代码:如下(按类似的问题的建议)并没有解决我的问题。
using: function(position, feedback) {
/* fix tooltip not hiding problem */
if($(".ui-tooltip").length>1){
// since the new tooltip is already added, there are now 2.
// removing the first one fixes the problem
$(".ui-tooltip")[0].remove();
}
$(this).css(position);
$("<div>")
.addClass("arrow")
.addClass(feedback.vertical)
.addClass(feedback.horizontal)
.appendTo(this);
}
}
});