时间:2021-07-01 10:21:17 帮助过:196人阅读
var lastFired = new Date().getTime();
setInterval(function() {
now = new Date().getTime();
if(now - lastFired > 5000) { // if it's been more than 5 seconds
alert("onfocus");
}
lastFired = now;
}, 500);