title: Touchend not firing after touchmove
body: <p>I'm trying to make a page for mobile devices that detects the <code>scrollTop</code> position and scrolls to the top of the page if <code>scrollTop</code> is lower than half the document height or scroll to bottom if its not.</p>
  
  <p>I have achieved that by using this:</p>
  
  <pre><code>var ScrollTimeout;
  $(window).on('scroll',function(){
      clearTimeout(ScrollTimeout);
      ScrollTimeout = setTimeout(scrollToTopOrBottom,200);
      });
  </code></pre>
  
  <p>The problem is that the timeout fires when the user has stopped scrolling but still has the finger on the screen.</p>
  
  <p>Then I worked with the <code>touchend</code> event and it was great. </p>
  
  <pre><code>$(document).on('touchend',function(){
      scrollToTop();
      });
  </code></pre>
  
  <p>The user could stopped scrolling (with the finger still on the screen) and then continue scrolling without triggering the <code>scrollToTopOrBottom()</code> function.</p>
  
  <p>The problem is, that event is incosistent between browsers:</p>
  
  <p>In some browsers (Maxthon and Android), the <code>touchend</code> event worked as intended but in Opera Mobile and Chrome, the <code>touchend</code> event doesn't fires. The explanation for this is that <a href="https://stackoverflow.com/questions/7691551/touchend-event-in-ios-webkit-not-firing"><code>touchend</code> doesn't fires because <code>touchcancel</code> has been fired before</a>.</p>
  
  <p>I've tried this</p>
  
  <pre><code>$(document).on('touchmove',function(e){
      e.preventDefault();
      });
  </code></pre>
  
  <p>and succesfully avoided the triggering of <code>touchcancel</code>, but unluckily also avoided the natural behaviour of scrolling.</p>
  
  <p>Does anyone know how can this be achieved? I'm completely out of ideas.</p>
  
  <p>Thanks.</p>