title: Smooth Scroll Using window.scrollBy
body: <p>I'm trying to smoothly scroll a page using setInterval() and window.scrollBy()</p>
  
  <p>I would use jQuery's animate function, but the animation needs to be continuous and loop infinitely (the page contents will be infinite).</p>
  
  <p>The idea is fairly simple:</p>
  
  <pre><code>var x = 1;
  var y = 1;
  
  setInterval(function() {
      window.scrollBy(0, x);
  }, y);
  </code></pre>
  
  <p><strong>How can I increase the scroll speed without making the animation appear jumpy?</strong></p>
  
  <p>I'm experience two problems:</p>
  
  <ol>
  <li>setInterval() can't take a Y value less than 1 (or probably closer to 30, depending on browser limits)</li>
  <li>Increasing the value of X causes the animation to be jumpy (due to pixels being skipped altogether)</li>
  </ol>
  
  <p>Here's a fiddle to experiment with:</p>
  
  <p><a href="http://jsfiddle.net/eoojrqh6/2/" rel="noreferrer">http://jsfiddle.net/eoojrqh6/2/</a></p>
  
  <p>Thanks!</p>