Is there a way to stop setTimeout("myfunction()",10000);
from counting up when the page isn't active. For instance,
- A user arrives at a "some page" and stays there for 2000ms
- User goes to another tab, leaves "some page" open.
myfunction()
doesn't fire until they've come back for another 8000ms.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…