Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
isotope.javascript.js
jQuery(document).ready( function() {
var $grid = jQuery('.grid').isotope({
itemSelector: '.grid-item',
layoutMode: 'fitRows',
getSortData: {
title: '.title',
date: '.date'
}
})
jQuery('.category').each( function() {
jQuery(this).closest('.grid-item').addClass(jQuery(this).text().toLowerCase());
jQuery(this).remove();
})
jQuery('[data-filter]').click( function(e) {
e.preventDefault();
$grid.isotope({ filter: jQuery(this).data('filter') })
})
jQuery('[data-sortby]').click( function(e) {
e.preventDefault();
$grid.isotope({ sortBy: jQuery(this).data('sortby') })
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.