Created
January 7, 2015 09:23
-
-
Save magicspon/b3467bdc08543f199bdf to your computer and use it in GitHub Desktop.
Masonry/imagesLoaded setup
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
// init Masonry var | |
var msnry; | |
// containing wrapper | |
var container = $('.wrapper'); | |
// the element to be masonaryified | |
var el = $('.box'); | |
// pass as a callback into the imagesLoaded function | |
imagesLoaded(container, function() { | |
msnry = new Masonry( container[0], { | |
itemSelector: el | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment