title: iphone html animations?
body: <p>I am building an html native iPhone app using NimbleKit, and one portion involves an animation. I built a 320 by 230px 48 frame png sequence containing the animation, and am using javascript loops to play through it. here is a quick and dirty on the code</p>
  
  <pre><code>     var pic = 0;
      function stamp(){
          //alert("animated");
          //alert("Stamp");
          var image;
          if(pic&lt;=48){
          image = "url('Animations/Smiley/"+pic+".png')";
          $('#animation').css("background-image",image);
          pic++;
          }
  
      }
      function beginStamp(){
          var stamp = window.setInterval("stamp()", 33.33);
          window.setTimeout("clearIt()", 1599.84);
      }
  
      function clearIt(){
  
          window.clearInterval(stamp);
          $('#animation').css("z-index",0);
  
      }
  
      var animated = setTimeout("animate()",600);
      var start = setTimeout("beginStamp()",1600);
  </code></pre>
  
  <p>the problem is, the animation is very choppy and flickers a ton. All the pictures are locally stored, so its not a network speed/ downloading issue. After the first run the animation runs smoother, so is it being cached? there is still a lot of flickering. does anybody know how to fix this, or a better method (as I'm sure there is one) using html,css,js, query, and nimble kit sdk to do mobile optimized iterating animations? Thanks!</p>