title: How to set jQuery draggable min/max-left and min/max-right
body: <p>I made a copy of JSbin for practice, JSbin <a href="https://jsbin.com/gififikisa/edit?html,css,js,output" rel="nofollow">link here</a>, actual site <a href="http://79.170.40.181/emory.com/Project04/index.html" rel="nofollow">link here</a>. </p>
  
  <p>This is just a practice for making the front-end of websites as I just started learning web dev little over a week ago. You can put in html, css and javascript in the editboxes, and a page spit out in Output just like the actual JSbin.</p>
  
  <p>But the problem is that you can resize the divs pass other divs.</p>
  
  <p>My idea to prevent this from happening is:<br>
  1. get the editboxes' current positions <br>
  2. store the left/right position of the editbox if resized to 10% window width<br>
  3. set the min/max left and right for the draggable div</p>
  
  <p>And hence the question. How do I set the max-left/right for the draggable.</p>
  
  <p>Also, any idea on why the draggable before Output div is diificult to drag to the right.</p>
  
  <p>Edit: How the site is structured. When you drag the .drag (.resize in my JSbin code), it changes its left and right div's left and right. And the draggables are contained in the #main's div.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="main&gt;
    &lt;div id="HTML"&gt;&lt;/div&gt;
                  
    &lt;div class="drag"&gt;&lt;/div&gt; //drag this left and right to change the right of the HTML and left of CSS
                       
    &lt;div id="CSS"&gt;&lt;/div&gt;
                 
    &lt;div class="drag"&gt;&lt;/div&gt; //drag this left and right to change the right of the Css and left of JavaScript
                       
    &lt;div id="JavaScript"&gt;&lt;/div&gt;
                        
    &lt;div class="drag"&gt;&lt;/div&gt; //drag this left and right to change the right of the JavaScript and left of Output
                       
    &lt;div id="Output"&gt;&lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>