title: How to stop Div Moving out of the border Jquery draggable();
body: <p>How to stop the div from moving out of the border div </p>
  
  <p>Here is the code i got so far.</p>
  
  <pre><code>  &lt;script&gt;
   $(document).ready(function() {
   $("#draggable").draggable({ grid: [50, 20] });
    });
    &lt;/script&gt;
    &lt;div id="drag_border"&gt;
    &lt;div id="draggable" style="width:500; height:800"&gt;Drag me&lt;/div&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p>Thank you,</p>