谁能告诉我我的代码有什么问题?qtip在鼠标上工作ok第一次,但第二次它显示了2个工具提示,一个有什么我在标题属性和另一个在那上面是空的。
$(document).ready(function() {
$(".tooltip").bind('mouseover', function() {
$(this).qtip({
overwrite: false,
show: {
ready: true
}
});
});
});
尝试设置overwrite
为true
确定当.qtip()方法在具有提示已经存在,新提示覆盖(即破坏)旧提示一个。默认为true。
如果设置为false,则每个mouseover
创建一个新的qtip
您不必绑定鼠标悬停。Qtip可以做到。
$(document).ready(function () {
$('.tooltip').qtip({
overwrite: true,
show: {
ready: true
}
});
});
编辑:你没告诉我阿贾克斯的事。这应该行得通(jsFiddle case);
$(document).ready(function() {
$(".tooltip").bind('mouseover', function() {
var $this = $(this);
if($this.data('qtip') == null) {
$this.qtip({
overwrite: true,
show: {
ready: true
}
});
}
});
});