Skip to content

Instantly share code, notes, and snippets.

@loginx
Created February 15, 2011 17:35
Show Gist options
  • Save loginx/827864 to your computer and use it in GitHub Desktop.
Save loginx/827864 to your computer and use it in GitHub Desktop.
Extends Isotope, providing a reset() method to empty the grid and reLayout.
// Adds a .isotope( 'flush' ) method to your Isotope widget.
// This method will remove all items from the widget and from the DOM,
// then trigger a reLayout.
$.Isotope.prototype.flush = function() {
this.$allAtoms = $();
this.$filteredAtoms = $();
this.element.children().remove();
this.reLayout();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment