我试图显示和隐藏悬停元素上的元素。我的代码工作,但是当用户鼠标悬停及移出元素非常快,动画就跑甚至鼠标移开它:(jquery停止动画,如果另一个仍在运行
$('.EventNameList').hover(
function() {
$(this).stop().animate({ backgroundColor: '#eaeaea' }, 200, "easeInQuad");
$(this).find('div#TrainingActionButtons').show("fast");
},
function() {
$(this).stop().animate({ backgroundColor: '#ffffff' }, 800, "easeOutQuad");
$(this).find('div#TrainingActionButtons').hide("fast");
});
});
和HTML:
<tr>
<td class="EventNameList">
<div id="TrainingActionButtons">
Some text
</div>
</td>
</tr>
可能重复:http://stackoverflow.com/questions/4666227/jquery-issue-with-hoverintent-and-show-hide-for-div/4667207#4667207 – ifaour 2011-01-14 17:05:04