title: Programmatically sort jquery-ui sortable?
body: <p>I have a bunch of divs inside a <code>display:flex</code> parent div. The parent div is sortable with jquery-ui's <code>sortable</code> function.</p>
  <p>As well as allowing the user to sort, I would like to add some buttons that do an animated sort.</p>
  <p>For example, with this HTML:</p>
  <pre><code>&lt;div class=&quot;sortable&quot;&gt;
    &lt;div id=&quot;div1&quot;&gt;&lt;/div&gt;
    &lt;div id=&quot;div2&quot;&gt;&lt;/div&gt;
    &lt;div id=&quot;div3&quot;&gt;&lt;/div&gt;
    &lt;div id=&quot;div4&quot;&gt;&lt;/div&gt;
    &lt;div id=&quot;div5&quot;&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  <p>I would like a button that when pressed would animate moving div1 to be between div4 and div5, moving smoothly (in fact, a little erratically as if it were being moved by hand would be even better) and shifting all the divs it passes, so it looks as if it were being moved by hand.</p>
  <p>Is this possible using jquery-ui's sortable(), or am I better off building a custom solution?</p>