Last active
December 15, 2015 13:39
-
-
Save noeljackson/5269039 to your computer and use it in GitHub Desktop.
isotope.js acting more responsively
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$( 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