var before = null;
requestAnimationFrame(function animate(now) { var c = earth.getPosition();
elapsed = before? now - before: 0; before = now;
earth.setCenter([c[0], c[1] + 0.1*(elapsed/30)]);
requestAnimationFrame(animate);
});before变量是开关变量,
怎么通过开关去判断requestAnimationFrame(animate)方法是否去执行?
现在需要停止这个动画方法,该怎么做?
Cats萌萌
慕桂英4014372
随时随地看视频慕课网APP
相关分类