几个指定的HTML文章:防止事件(这)元素一样
<article id="someId" class="some_wrapper">
<section class="info_wrapper">
<section class="info">
<p>Content</p>
</section>
</section>
</article>
Cobined一些基本的jQuery的,如:
$(".some_wrapper").mouseenter(function(){
$(this).find(".info").fadeIn(500);
});
$(".some_wrapper").mouseleave(function(){
$(this).find(".info").fadeOut(500);
});
问题:如果用户移动鼠标快速severel倍从.some_wrapper
到另一个,事件处理程序多次触发并建立队列fadeIn()
和的效果。即使老鼠已经站在集装箱外面,只要经常发生这种情况,这些情况就会发生。
如何防止和mouseleave()
上的$(this)
元素,其中.info
可见。或者打破队列?
感谢。
不错!那有多容易!非常感谢你。 –