title: Is there a way to trigger mouseup when leaving the document body?
body: <p>I found some code and I made a <a href="http://jsfiddle.net/vp14utt1/" rel="nofollow">jsfillde</a> with it. I need to know how to trigger mouseup in the function below, when you leave document body (in the fiddle example it's like dragging the object into HTML section for instance and leave the mouse click there).</p>
  
  <pre><code>function handleMouseMove(e) {
      if (canMove) {
          var left = getMousePosX(e);
          var top = getMousePosY(e);
          var newLeft = ($(elemToMove).css('left').toDecNum() + (left - lastPosX));
          var newTop = ($(elemToMove).css('top').toDecNum() + (top - lastPosY));
  
          $(elemToMove).css('left', newLeft);
          $(elemToMove).css('top', newTop);
          lastPosX = left;
          lastPosY = top;
      }
  
      return false;
  }
  </code></pre>
  
  <p>Thanks for any suggestion.</p>