title: jQuery sortable initial load menu order not correct
body: <p>I have a sequence in my database that stores numbers like so:</p>
  
  <p><strong>3, 7, 9, 11, 15</strong></p>
  
  <p>I pull this sequence from my database and try sort the menu based on this sequence.</p>
  
  <p><strong>My divs are like so:</strong></p>
  
  <pre><code>&lt;div id="menu_left"&gt;
      &lt;div id="item_box_3"&gt;3&lt;/div&gt;
      &lt;div id="item_box_7"&gt;7&lt;/div&gt;
      &lt;div id="item_box_9"&gt;9&lt;/div&gt;
      &lt;div id="item_box_11"&gt;11&lt;/div&gt;
      &lt;div id="item_box_15"&gt;15&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>My jQuery is the following: 'data' is: 3, 7, 9, 11, 15 - this is then split into an array.</p>
  
  <pre><code>var orderArray = data.split(',');
  var listItems = $("#menu_left"), items = $("#menu_left &gt; div");
  
  for (var i = orderArray[orderArray.length - 1]; i &gt;= 0; i--) {
      listItems.prepend(items.get(orderArray[i] - 1));
  }
  </code></pre>
  
  <p>My sortable is saving completely fine, but when I retrieve this data value (3,7,9,11,15) it seems to not work. When I have (1 to 15 (15 items)) it works fine, which got me thinking is it because it thinks some items are missing? </p>
  
  <p>Any ideas?</p>
  
  <p><strong>Fiddle:</strong> <a href="https://jsfiddle.net/ocrwp81b/" rel="nofollow noreferrer">https://jsfiddle.net/ocrwp81b/</a></p>