【发布时间】:2011-12-19 05:40:52
【问题描述】:
我有这段制作图像动画的代码,但我想在动画完成后通过调用clearTimeout(gLoop);调用函数AnotherAction()
var Animate = function(){
Clear();
MoveDown();
gLoop = setTimeout(Animate,40);
}
var MoveDown = function(){
// animation code
if(velocity==0){
clearTimeout(gLoop);
AnotherAction(); //Here is not working
}
}
我应该在哪里打电话给AnotherAction()?
【问题讨论】:
标签: javascript html canvas settimeout