<script>
     function aaa() {
         window.counter = window.counter||1;
         console.log(window.counter);
         window.counter++;
         window.caonima= setTimeout('aaa()', 1000);
     }
     $(document).ready(function () {
         $('#c1').click(function () {
             if (window.caonima) {
                 clearTimeout(window.caonima);
                 window.counter = 1;
             }
             aaa();
         })
     })
 </script>

多次调用settimeout 如何使用单例模式

相关文章:

  • 2022-01-09
  • 2022-12-23
  • 2021-07-24
  • 2021-07-30
  • 2021-08-27
  • 2023-04-08
  • 2021-11-19
猜你喜欢
  • 2022-12-23
  • 2021-12-06
  • 2022-12-23
  • 2022-03-01
  • 2022-12-23
  • 2021-12-02
  • 2022-03-10
相关资源
相似解决方案