Browse Source

add shuffle method; Ref #719

pull/726/head
David DeSandro 11 years ago
parent
commit
33daf3691a
  1. 11
      js/isotope.js

11
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

Loading…
Cancel
Save