title: jQuery Mousemove: trigger on change of 5px
body: <p>For a number of technical reasons, I'm implementing my own 'draggable' feature on jQuery, rather than using jQuery UI, and I'm using mousedown and mousemove events to listen for the user trying to drag an element. </p>
  
  <p>It works good so far, I would just like to fire up the mousemove event every 5 px of movement, rather than pixel by pixel. I've tried coding a simple:</p>
  
  <pre><code>$('#element').bind('mousemove', function(e) {
      if(e.pageX % 5 == 0) {
          // Do something
      }
  });
  </code></pre>
  
  <p>However, the movement is not stable every 5 pixels, and sometimes if you move the mouse too fast, it will skip several steps. I think this is because when moving the mouse very fast, jQuery will not trigger the event every pixel. </p>
  
  <p>Do you guys know how to trigger the event every 5 pixels?</p>
  
  <p>Thanks a lot,</p>
  
  <p>Antonio</p>