I’m trying to create a thumbnail gallery with rows of 3 items and I’m not able to control the width (192px) or the gutters (10px) of the items. Heres my code
<script>
$(function(){
var $container = $('.isosort'),
filters = {};
$container.isotope({
layoutMode : 'fitRows',
animationEngine : 'best-available',
masonry: {
columnWidth: 192,
gutterWidth: 10
}
});
// filter buttons
$('#options li ul li a').click(function(){
var $this = $(this);
// don't proceed if already selected
if ( $this.hasClass('selected') ) {
return;
}
var $optionSet = $this.parents('.option-set');
// change selected class
$optionSet.find('.selected').removeClass('selected');
$this.addClass('selected');
// store filter value in object
// i.e. filters.color = 'red'
var group = $optionSet.attr('data-filter-group');
filters[ group ] = $this.attr('data-filter-value');
// convert object into array
var isoFilters = [];
for ( var prop in filters ) {
isoFilters.push( filters[ prop ] )
}
var selector = isoFilters.join('');
$container.isotope({ filter: selector });
return false;
});
});
</script>
My understanding is that to use the masonry options, you’re required to choose “
masonry” as yourlayoutMode.