我正在使用jquery 线索提示,我注意到在某些情况下,我第一次单击某个项目时会显示两次关闭文本,当我第二次单击时,它只显示一次。所以我第一次看到这个:
我第二次看到这个:
有没有人见过这个?我在页面上有多个线索提示,但看不出这将如何推动这一点。这是我的提示 javascript 代码:
$('#myItem').cluetip({
width: '500px',
showTitle: false,
topOffset: 25,
leftOffset: 5,
positionBy: 'bottomTop',
cluetipClass: 'jtip',
activation: 'click',
hoverIntent: {
sensitivity: 7,
interval: 100,
timeout: 500
},
sticky: true,
mouseOutClose: true,
ajaxSettings: {
dataType: 'json'
},
ajaxProcess: function (data) {
return data.Content;
}
});
我看到这里和这个论坛上也出现了错误,但我没有看到任何解决方案或建议。
更新:
不确定这是否有帮助,但我在萤火虫中捕获了“双重”情况,这是生成的 html。如您所见,有多个 id="cluetip-close" 的元素
<div id="cluetip-inner"><div id="cluetip-close"><a href="#">Close</a></div><div id="cluetip-close"><a href="#">Close</a></div>
我已经调试了线索提示代码,当我多次关闭时,我注意到当它到达这一行时:
if (opts.sticky) {
var $closeLink = $('<div id="cluetip-close"><a href="#">' + opts.closeText + '</a></div>');
$cluetipInner 已经有 '
我仍然无法弄清楚这是在什么情况下发生的。. 我可以重现它的唯一方法是清除所有浏览器缓存然后重新启动。. ajax回调可能有一些时间问题?