title: Dragging image within a boundary using jQuery
body: <p>I am trying to make an image draggable in a boundary using jQuery but I can only drag it vertically. How can I freely drag it within a boundary?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$("#map").draggable({
    containment: 'parent'
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="//code.jquery.com/ui/1.11.4/jquery-ui.js"&gt;&lt;/script&gt;
  &lt;link rel="stylesheet" type="text/css" href="//code.jquery.com/ui/1.11.4/themes/ui-lightness/jquery-ui.css"&gt;
  
  &lt;div id="parent" style="width: 800px; height: 700px"&gt;
    &lt;div id="map" class="map"&gt;
      &lt;img src="Images/map.PNG" style="width:500px; height:350px;"&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>