.stop().built-in_func和.built-in_func有什么区别,如下所示:
$('selector').stop().animate({//code to be executed});
$('selector').animate({//code to be executed});
.stop().built-in_func和.built-in_func有什么区别,如下所示:
$('selector').stop().animate({//code to be executed});
$('selector').animate({//code to be executed});
一个会在动画之前停止任何当前正在播放的动画,而另一个则不会。
$('selector').stop().animate({//要执行的代码});
此行首先停止匹配元素上的任何正在运行的动画(通过选择器),然后通过调用该animate(...)
函数开始一个新动画
$('selector').animate({//要执行的代码});
但是这条线启动了一个可以与其他正在运行的动画重叠的动画(如果队列设置为 false)。当队列设置为 true 时,它会等待匹配元素上的其他正在运行的动画,一旦它们被终止,就会开始新的动画。
请看这个小提琴以了解区别:http:
//jsfiddle.net/N69sV/