jQuery Detect continual mousedown
<p>Is there a way to detect continual mousedown? In other words, I want a function to continue to run while the left mouse button is being pressed. Here is an example of what im trying to do. I have a button that controls the scrollLeft position. It increments by 20 on every click, but I want it to continue incrementation while the mouse button is left pressed and stop onmouseup.</p>

<p>Similar to how the arrows on a scroll bar work when you leave the mouse button pressed</p>

<pre><code>    var wrapperDiv = $("#wrapper-div");
    var scrollWidth = 0;

    $("#right-button").click(function() {
      if(scrollWidth &lt; wrapperDiv[0].scrollWidth) {
        scrollWidth = scrollWidth+20;
        wrapperDiv.scrollLeft(scrollWidth);
      }

});
</code></pre>
