title: How to auto scroll a div at configurable speed?
body: <p>I am building a scrolling application that requires users to configure the scroll speed.</p>
  
  <p>Here is my current code:</p>
  
  <pre><code>function scroll() {
          var overlay = document.getElementById('overlay');
          overlay.scrollTop = overlay.scrollTop + 2;
      }
  
      function togglescrolling() {
          if (goscrolling == false) {
              window.clearInterval(scrollinterval);
              scrollinterval = window.setInterval(scroll, 0);
              goscrolling = true;
          } else {
              goscrolling = false;
              window.clearInterval(scrollinterval);
          }
      }
  </code></pre>
  
  <p>This code works and it autoscrolls to bottom of the page as planned but it scrolls very fast and I would like to configure this speed. </p>
  
  <p>I used jQuery Animate in the past and not sure if it is really helping. </p>