I am trying to find a way to stop the fadeIn / fadeOut animation when the mouse is above the black area:
http://jsfiddle.net/AeZP4/1/
$(function(){ $('.text').mouseenter(function(){ $(this).stop(true,true).fadeOut(); }).mouseleave(function(){ $(this).stop(true,true).fadeIn(); }); });
<div id="container"> <div class="text">s</div> </div>
#container{width:600px; height:100%; position:relative;} .text{position:absolute; left:0; top:0; width:200px; height:800px; background:#000000;}
Each time the mouse moves inside this area, the function loops. How can i avoid this?
source share