title: javascript + jquery + setinterval + animation
body: <p>I'm having a problem with setInterval and jquery animate.  Here is my code:</p>
  
  <pre><code>function slides1() {
  
      ...
  
      $("table#agah1").animate({
          "left": first1
      }, "slow");
      $("table#agah2").animate({
          "left": first2
      }, "slow");
  }
  
  $(function () {
      cyc = setInterval("slides1()", 3000);
  });
  </code></pre>
  
  <p>When switch to another browser tab, and return after a time, the animation keep doing it without delay, for the time I've been away from the tab, and then act correct. I've added these also without any luck:</p>
  
  <pre><code>$(window).focus(function () {
      jQuery.fx.off = false;
      cyc = setInterval("slides1()", 3000);
  });
  $(window).blur(function () {
      jQuery.fx.off = true;
      window.clearInterval(cyc);
  });
  </code></pre>