title: Draggable div without jQuery UI
body: <p>I'm trying to make a <code>div</code> draggable without using jQuery UI.</p>
  <p>However, I'm stuck with the code below. I understand that I should use the mouse position relative to the container <code>div</code> (in which the <code>div</code> will be dragged) and that I should set the <code>div</code>'s offset relative to those values.</p>
  <p>I just can't figure out how. Any clues?</p>
  <p>This is the code that doesn't (of course) work:</p>
  <pre><code>var X, Y;
  
  $(this).mousedown(function() {
      $(this).offset({ 
          left: X, 
          top: Y
      });
  });
  
  $(&quot;#containerDiv&quot;).mousemove(function(event) {
      X = event.pageX;
      Y = event.pageY;
  });
  </code></pre>