我有一个小的jQuery动画,当悬停在一个元素上时,它会淡入一个链接:
$(function() {
$('.delete').hide();
$('#photos img').hover(function() {
$(this).parents('li').children('.delete').fadeIn('fast');
}, function() {
$(this).parents('li').children('.delete').fadeOut('fast');
});
});
但是,如果我快速地在图像内外移动鼠标,新的动画总是被添加到队列中,当我停止时,我可以看到链接在一段时间内闪烁。我尝试使用 .stop(true),但有时淡入效果根本不起作用(或者只起到了小于1的某个不透明度值)。我该怎么办?
谢谢,Eric