启动定时器:
window.setInterval(Method,Time)
Method是定时调用的js方法:Time是间隔时间,单位是毫秒
取消定时器:
clearInterval(Method);
var timeout = false; //启动及关闭按钮 function time() { if(timeout) return; Method(); setTimeout(time,100); //time是指本身,延时递归调用自己,100为间隔调用时间,单位毫秒 }
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/218157.html原文链接:https://javaforall.net
