Skip to content

Instantly share code, notes, and snippets.

@magicspon
Created January 7, 2015 09:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save magicspon/b3467bdc08543f199bdf to your computer and use it in GitHub Desktop.
Save magicspon/b3467bdc08543f199bdf to your computer and use it in GitHub Desktop.
Masonry/imagesLoaded setup
// 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