Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试创建一个倒计时计时器,从 60 秒倒计时到 0。我不确定 A.如何将重复次数限制为 60 和 0。如何减少倒计时
我承认您的问题与画布无关,但这是倒计时的代码:)
(function(){ var sec = 60; var id = window.setInterval(function() { sec--; if (sec < - 1) { clearInterval(id); alert("Time complete"); return; } }, 1000/60) })();