Function repeating when page not being viewed
<p>I have created a self-repeating function using JavaScript, however when I navigate to another tab open in my browser and go back to the tab containing the function; the function is repeating at a much faster pace than specified; can anybody shed any light on why this may happen?</p>

<p>Example of JavaScript Used:</p>

<pre><code>function aFunction() {
    var aFunctionVar;
    clearTimeout(aFunctionVar);
    aFunctionVar = setTimeout(aFunction,8000);
    if (condition) {
        //More code to run...
        return false; 
    }
    if (condition) {
        //More code to run...
        return false; 
    } 
};
aFunction();
</code></pre>
