diff --git a/js/isotope.js b/js/isotope.js index c44df89..8da4cc2 100644 --- a/js/isotope.js +++ b/js/isotope.js @@ -549,6 +549,17 @@ function isotopeDefinition( Outlayer, getSize, matchesSelector, Item, LayoutMode } }; + Isotope.prototype.shuffle = function() { + // update random sortData + for ( var i=0, len = this.items.length; i < len; i++ ) { + var item = this.items[i]; + item.sortData.random = Math.random(); + } + this.options.sortBy = 'random'; + this._sort(); + this._layout(); + }; + /** * trigger fn without transition * kind of hacky to have this in the first place