title: JavaScript on iOS: preventDefault on touchstart without disabling scrolling
body: <p>I am working with JavaScript and jQuery in an UIWevView on iOS. </p>
  
  <p>I'v added some javascript event handler that allow me to capture a touch-and-hold event to show a message when someone taps an img for some time:</p>
  
  <pre><code>$(document).ready(function() {
  
      var timeoutId = 0;
      var messageAppeared = false;
  
      $('img').on('touchstart', function(event) {
  
          event.preventDefault();
          timeoutId = setTimeout(function() {           
  
              /* Show message ... */
              messageAppeared = true;
  
          }, 1000);
  
      }).on('touchend touchcancel', function(event) {                                
  
          if (messageAppeared) {
              event.preventDefault();
          } else {
              clearTimeout(timeoutId);
          }
          messageAppeared = false;        
      });
  });
  </code></pre>
  
  <p>This works well to show the message. I added the two "event.preventDefault();" lines to stop imgs inside links to trigger the link.</p>
  
  <p>The problem is: This also seems to prevent drag events to scroll the page from happen normally, so that the user wouldn't be able to scroll when his swipe happens to begin on an img.</p>
  
  <p>How could I disable the default link action without interfering with scrolling?</p>