title: Cancel scrolling after user interaction
body: <p>My webpage animates scrolling when users click on links to the same page. I want to cancel this animation as soon as the user tries to scroll (otherwise the user and the browser are fighting for control) – no matter whether with the mouse wheel, the keyboard or the scrollbar (or any other way – are there other ways of scrolling?). I managed to cancel the animation after the mouse wheel or keyboard are used, how do I get this working with the scrollbar?</p>
  
  <p>Here is how my code looks for the keyboard:</p>
  
  <pre><code>$(document.documentElement).keydown( function (event) {
      if(event.keyCode == 38 || 40) stopScroll();
  });
  
  function stopScroll() {
      $("html, body").stop(true, false);
  }
  </code></pre>
  
  <p>I also tried a more elegant way of doing this by using <code>scroll()</code>, the problem is that <code>scroll()</code> catches everything including the animated and automated scrolling. I could not think of any way to let it catch all scrolling except the animated scrolling.</p>