Skip to content

Instantly share code, notes, and snippets.

@dylan-k
Created December 18, 2013 19:22
Show Gist options
  • Save dylan-k/8028186 to your computer and use it in GitHub Desktop.
Save dylan-k/8028186 to your computer and use it in GitHub Desktop.
masonry for bootstrap
<!--
Snippet Name: Masonry for Bootstrap
Description: Masonry is a JavaScript grid layout library. This code will add masonry abilities to any Bootstrap page.
Usage: paste this sucker at the bottom of your HTML. Note the #container and .thumbnail items. You can change those as needed.
-->
<!-- Load JS and start masonry -->
<script type="text/javascript" src="http://masonry.desandro.com/masonry.pkgd.min.js"></script>
<script type="text/javascript">
// MASSONRY Without jquery
var container = document.querySelector('#container');
var msnry = new Masonry( container, {
itemSelector: '.thumbnail',
columnWidth: '.thumbnail',
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment