title: Javascript Intval Show/Hide Flickering
body: <p>I'm trying to cycle real fast through a series of images to produce an animation using the below setInterval. However, if I move focus away from the browser tab and then back again, the animation flickers.</p>
  
  <p>I saw a thread about using "real time" to catch the animation up, but since mine uses a simple show/hide, I wasn't sure how that applied.</p>
  
  <pre><code>var animation = setInterval(function(){
  
      var visible = $j('#container img:visible');
      var next    = visible.next('img');
  
      if(next.length &lt;= 0) next = $j('#container img:first');
  
      next.show();
      visible.hide();
  
  },64);
  </code></pre>
  
  <p>Any thoughts on how to combat the flickering?</p>