<p>You can order the elements based off a function you supply. In the demo above, each item has a <code>data-date-created</code> and <code>data-title</code> attribute. When the select option menu changes, a sort object is passed to shuffle.</p>
<p>The <codeclass="language-javascript">opts</code> parameter can contain two properties. <codeclass="language-javascript">reverse</code>, a boolean which will reverse the array. <codeclass="language-javascript">by</code> is a function that is passed the element wrapped in jQuery. In the case above, we’re returning the value of the data-date-created or data-title attributes.</p>