我被给了一个简单的项目,使用jquery显示带有mouseover事件的图像。我们的目标是仅当它是mousedover时才显示qtip,并且事先将它们全部绑定在负载上,而且速度很慢。他们使用qtip 1.0,我遇到了'太多递归错误',并且无法识别递归发生的位置。我做了一些研究,它可能与事件冒泡有关,但尚未能解决它。Qtip:1.0太多的递归
$(document).ready(function(){
$(".employee").hover(function(event) {
event.stopPropagation();
var content = '<img src="/upload_test/';
<!-- content += $(this).attr('id'); -->
content += 'test.jpg';
content += '" alt="Loading thumbnail..." height="202" width="254" />';
$("#" + event.target.id).qtip(
{
content: content,
position: {
corner: {
tooltip: 'leftTop',
target: 'leftTop'
}
},
style: {
height:202,
width:280,
border: {
width: 7,
radius: 5,
color: 'black'
}
// Give it a speech bubble tip with automatic corner detection
},
hide: { fixed: true, delay: 1000 }
});
});
});
任何更新qtip2的机会? – mplungjan
我对此表示怀疑,除非绝对必要,否则不会升级。 –
也许它会在您每次悬停时创建一个新实例。你可以在创建它之前尝试摧毁它。 '$(“#”+ event.target.id).qtip('destroy');' – Moob