setInterval 方法用于以指定的间隔调用函数或执行代码块。但是,当不再需要计时器时,必须停止它以释放未使用的资源。
停止 setInterval 方法有两种方法:
clearInterval
方法
clearTimeout
方法
clearInterval
方法
clearInterval
方法用于停止由
setInterval
方法创建的计时器。它接受一个参数,这是要停止的计时器的 ID:
本文地址:https://www.qianwe.com/article/9bc01266d4fb40e15f08.html
上一篇:如何停止JavaScript中的setInterval如何停...
下一篇:marginrightmargin模型...