title: iScroll returns to top when touch event ends
body: <p>I've got an iOS web app that is proving to be a really difficult with regards to scrolling! The closes I have come to solving the issue is with iScroll 4. However when I remove my finger from the screen the scrolling part seems to return back to its original position.</p>
  
  <p>Anybody got any ideas on why this might be and how to fix it?</p>
  
  <p>The Script:</p>
  
  <pre><code>&lt;script&gt;
          var myScroll;
          function loaded() {
              myScroll = new iScroll('wrapper');
          }
  
          document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
  
          /* * * * * * * *
           *
           * Use this for high compatibility (iDevice + Android)
           *
           */
          document.addEventListener('DOMContentLoaded', function () { setTimeout(loaded, 200); }, false)
  
  &lt;/script&gt;
  </code></pre>
  
  <p>The HTML:</p>
  
  <pre><code>&lt;div id="wrapper"
           style="position:absolute;
           width:600px;
           overflow:auto;
           height: 500px;"&gt;
  
          &lt;div id="scroll-content"
               style="position:absolute;
               width:600px;
               padding:0;
               height: 500px;"&gt;
  
                // The text that needs to be scrolled
  
          &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>UPDATE:
  The following states that weird behavior such as rubber band effect should be fixed by changing the way iScroll is loaded. I have changed the loading as explained but I am still getting the rubber banding pinging the scrolled area back to the top when I let go.</p>
  
  <blockquote>
    <p>Sometimes the DOMContentLoaded is a bit hasty and get fired when the
    contents are not ready. If you slip into some weird behaviors (eg:
    rubber band effect), try the following:</p>
  </blockquote>
  
  <pre><code>&lt;script type="application/javascript" src="iscroll.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt; var myScroll; function loaded() {
      setTimeout(function () {        myScroll = new iScroll('wrapper');  },
   100); } window.addEventListener('load', loaded, false); &lt;/script&gt;
  </code></pre>