title: Positioning problem with resizable div - is there a way to limit movement of .ui-resizable-se?
body: <p>I'm hoping to implement the following resizing technique on my website to give the user the option to scale a modal. It utilizes a wrapper to trigger the scaling of the content within it. </p>
  
  <p>My code is here: <a href="https://codepen.io/jsprac/pen/LoMgWm" rel="nofollow noreferrer">https://codepen.io/jsprac/pen/LoMgWm</a></p>
  
  <pre><code>var $el = $("#very-specific-design");
  var elHeight = $el.outerHeight();
  var elWidth = $el.outerWidth();
  
  var $wrapper = $("#scaleable-wrapper");
  
  // invisible wrapper is doing the resizing, so .ui-resizable-se corresponds to it... how could I limit its movement? currently, it's moving in respect to said wrapper. 
  
  $wrapper.resizable({ 
    resize: doResize
  });
  
  function doResize(event, ui) {
  
    var scale;
  
    scale = Math.min(
      ui.size.width / elWidth,    
      ui.size.height / elHeight
    );
  
    $el.css({
      transform: "translate(-50%, -50%) " + "scale(" + scale + ")"
    });
  
  }
  
  var starterData = { 
    size: {
      width: $wrapper.width(),
      height: $wrapper.height()
    }
  }
  
  doResize(null, starterData);
  </code></pre>
  
  <p>The orange box represents the .ui-resizable-se handle. I'm running into problems with its movement, as it's positioned in respect to the wrapper. For the purpose of my site, I've set the background of the wrapper to transparent; I don't want it to be visible. </p>
  
  <p>To summarize: When I scale the div "very-specific-design", the .ui-resizable-se handle moves arbitrarily outside its boundaries (in correspondence to the wrapper, which the user won't see). Ideally, it'd be positioned on top of "very-specific-design" and move within its borders/not move at all. I may have to explore other options because I'm having difficulty finding a solution. (i.e. the associated jquery relies on the wrapper and, thus, the wrapper is the element that should resize). </p>
  
  <p>Thanks in advance for any insight!</p>