Skip to content

Instantly share code, notes, and snippets.

@Tsunamijaan
Created September 12, 2018 14:02
Show Gist options
  • Save Tsunamijaan/374a260659b84c07dbf8dc4ec5b501aa to your computer and use it in GitHub Desktop.
Save Tsunamijaan/374a260659b84c07dbf8dc4ec5b501aa to your computer and use it in GitHub Desktop.
// ======mixitup-filtering-with-masonary-start-here=====
// init Isotope
var $grid = $('#grid').isotope({
itemSelector: '.grid-item',
layoutMode: 'fitRows',
getSortData: {
name: '.name',
symbol: '.symbol',
number: '.number parseInt',
category: '[data-category]',
weight: function (itemElem) {
var weight = $(itemElem).find('.weight').text();
return parseFloat(weight.replace(/[\(\)]/g, ''));
}
}
});
$('.portfolio-menu').on('click', 'button', function () {
$(this).addClass('active').siblings().removeClass('active');
var filterValue = $(this).attr('data-filter');
$grid.isotope({filter: filterValue});
});
$('#grid').isotope({
// options...
itemSelector: '.grid-item',
masonry: {
columnWidth: 200
}
});
// ======mixitup-filtering-with-masonary-end-here=====
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment