好的,这是主要功能:
function updown(){
var bottom = $(document).height()-$(window).height();
//scroll to bottom. scroll to 0. and execute updown().
$('body')
.animate({scrollTop:bottom},20000)
.animate({scrollTop:0},2000,updown);
}
updown();
然后我正在使用:
$('body').stop(true);
在按钮上单击以停止动画队列
我的问题是如何再次启动动画队列?
所以例如$('body').play(true);
如果你得到了我所说的(虽然我知道它不像那么简单)。 。 。
提前感谢您提供任何帮助!
答案 0 :(得分:0)
您是否尝试过再次调用updown()?
答案 1 :(得分:0)
<button id="go">Go</button>
<button id="stop">STOP!</button>
function updown(){
...
}
updown();
/* Stop animation */
$("#stop").click(function(){
$(".body").stop();
});
/* Start animation */
$("#go").click(function(){
updown();
});
有关此内容的更多信息:http://api.jquery.com/stop/