Skip to content

Instantly share code, notes, and snippets.

@noeljackson
Last active December 15, 2015 13:39
Show Gist options
  • Save noeljackson/5269039 to your computer and use it in GitHub Desktop.
Save noeljackson/5269039 to your computer and use it in GitHub Desktop.
isotope.js acting more responsively
$( this ).imagesLoaded(function() {
$container = $( '#container' );
function gallery_item_width() {
width = Math.floor( ($('#primary').width()) / 3 );
$( '#container .item' ).width( width + 'px' );
}
$(window).smartresize( gallery_item_width() );
$container.isotope({
itemSelector : '.item',
masonry: {
columnWidth: gallery_item_width()
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment