Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I believe isotope caches sorts so it doesn't have to recalculate a sort that it has already done. It even does this on "random" it seems.</p> <p>A fix/hack is to <code>reloadItems</code> after the random sort:</p> <pre><code>$('#reorder').click(function () { $('.container').isotope({sortBy: 'random'}).isotope('reloadItems'); }); </code></pre> <p>Demo: <a href="http://jsfiddle.net/nT66r/" rel="nofollow">http://jsfiddle.net/nT66r/</a></p> <p>As for filtering the menu item, random simply returns a random number, so there is not a lot you can do. However, you can write a custom random sort which would allow you to "filter" the menu:</p> <pre><code>getSortData: { name: function ($elem) { return $elem.data('name'); }, myrandom: function ($elem) { if($elem.hasClass('menu')) { return -1; } return Math.random(); } } </code></pre> <p>Demo: <a href="http://jsfiddle.net/PvnMn/" rel="nofollow">http://jsfiddle.net/PvnMn/</a></p> <p>Note, because <code>menu</code> is a class, you leave yourself open to some possible weirdness if there are multiple <code>menu</code> items. If you only have one, an ID is a better choice. In that case, you would use <code>$elem.is('#menu')</code> instead of <code>$elem.hasClass('menu')</code>.</p> <p>With <code>#menu</code>: <a href="http://jsfiddle.net/PvnMn/1/" rel="nofollow">http://jsfiddle.net/PvnMn/1/</a></p> <p>Here is a version with my stab at filtering for other sorts: <a href="http://jsfiddle.net/jtbowden/Vuqgu/" rel="nofollow">http://jsfiddle.net/jtbowden/Vuqgu/</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload