【发布时间】:2016-09-17 22:51:48
【问题描述】:
我正在使用 HTML 画布。我希望仅在未再次触发单击功能时才请求新帧。基本上我希望它“停止”以前的递归,我想
document.addEventListener('click', function(){
[...]
var animate = function() {
if (the click event was NOT fired again) {
requestAnimationFrame(animate);
}
};
animate();
});
我该怎么做?
【问题讨论】:
标签: javascript html canvas