一个视频告诉你stop()的作用:
视频中的代码:
<style type="text/css">
ul li{ width:50px; height:30px; background:#333; margin-bottom:10px; color:#fff;}
</style>
<ul id="flyul">
<li>wod a </li>
<li>wod a </li>
<li>wod a </li>
<li>wod a </li>
<li>wod a </li>
</ul>
<script type="text/javascript" src="http://www.shundecity.com/templets/default/index/2013/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript">
$('#flyul li').mouseenter(function(){
$(this).stop().animate({
width:'300px'
},1000);
});
$('#flyul li').mouseleave(function(){
$(this).stop().animate({
width:'50px'
},1000);
});
</script>