实现定时调用的函数,可按照指定的周期(以毫秒计)来调用函数或计算表达式。
The steps-based animation that people try to use with setInterval code just ends up looking jerky.
用 setInterval 代码实现基于步骤的动画看起来有些抖动。
var id = setInterval(fn, delay); - Similar to setTimeout but continually calls the function (with a delay every time) until it is canceled.
var id = setInterval(fn delay); - 与setTimeout类似,只不过它会持续地调用指定的函数(每次都有一个延时),直到timer被取消为止。
实现定时调用的函数,可按照指定的周期(以毫秒计)来调用函数或计算表达式。
应用推荐