Is there a way to stop setTimeout(\"myfunction()\",10000); from counting up when the page isn\'t active. For instance,
setTimeout(\"myfunction()\",10000);
You can do something like:
$([window, document]).blur(function() { // Clear timeout here }).focus(function() { // start timeout back up here });
Window is for IE, document is for the rest of the browser world.