title: How to get a difference between two cursor positions at the two different moment?
body: <p>For example I have a one position of cursor, I put it in a some variable, and I want get a difference between this variable and cursor position after 10 ms. I have no idea what to do. </p>
  
  <p>I want to make a such drag'n'drop where might drag the element without focusing concretely it. All what I'm could do here, but it's bullshit, but may be it help you to understand what I actually want)).</p>
  
  <pre><code>    &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;example&lt;/title&gt;
      &lt;style&gt;
      .red {
      width:500px;
      height:100px;
      background:red;
          cursor: move;
      position:relative;
  }
  
  .green {
      width:100px;
      height:100px;
      background:green;
      position:absolute;
      left:0;
  }
  
      &lt;/style&gt;
      &lt;script src="http://code.jquery.com/jquery-2.1.0.min.js" type="text/javascript"&gt;&lt;/script&gt;
      &lt;script type="text/javascript"&gt;
          var draggble = false;
  var currentLeft;
  var currentX;
  
  $(document).on("mousedown",".red",function(){
      draggble = true;
      currentLeft = parseInt($(".green").css("left"),10);
  });
  
  $(document).on("mouseup", "body", function () {
          draggble = false;
  });
  
  $(document).on("mousemove","body",function(e){
      currentX = e.pageX;
      if(draggble){
          setTimeout(function(){
          currentLeft = currentLeft + currentX - e.pageX;
          $(".green").css("left",currentLeft);      
      },10);
      }
  });
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div class="red"&gt;
      &lt;div class="green"&gt;&lt;/div&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><a href="http://jsfiddle.net/f8Kx9/" rel="nofollow">http://jsfiddle.net/f8Kx9/</a></p>
  
  <p>I'm also sorry for my awful English, it's almost first time when I need to write. </p>