var timer = null; function starMove() { clearInterval(timer); other code... }
把你其他的代码也发上来,可能不是clearInterval(timer)这句的问题,看一下你的计算速度的代码是写在setInterval里面的不