title: Jquery/Javascript text slider loop running on setTimeout breaks when you leave the tab.
body: <p>Here is the website: esanexpharma.com.
  The divs are both using absolute positioning. </p>
  
  <p>Here is the code: </p>
  
  <pre><code>    var heroTextShow = function() {
        jQuery('.hero-1').fadeIn().delay(5000).fadeOut();
        jQuery('.hero-2').delay(5300).fadeIn(500).delay(2000).fadeOut();
        setTimeout(heroTextShow, 8700);
      };
  
      heroTextShow();
  </code></pre>
  
  <p>The code runs fine unless you got to another tab and then comeback in which case some sort of timing error is happening. I have also tried running this on a setInterval but ran into the exact same problem. Any insight would be appreciated. </p>