Skip to content

Instantly share code, notes, and snippets.

@zackkatz
Created December 19, 2018 23:06
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 zackkatz/a05669427e67fea772786e6da3149e6b to your computer and use it in GitHub Desktop.
Save zackkatz/a05669427e67fea772786e6da3149e6b to your computer and use it in GitHub Desktop.
GravityView Demo Site - DIY Layout Code
<script src="https://unpkg.com/isotope-layout@3/dist/isotope.pkgd.min.js"></script>
<script src="https://unpkg.com/imagesloaded@4/imagesloaded.pkgd.min.js"></script>
<script>
jQuery( document ).ready( function( $ ) {
// Fixed Layout
var $grid = $('.gv-diy-container').isotope({
// options...
itemSelector: '.gv-diy-view',
masonry: {
columnWidth: 150
}
});
// layout Isotope after each image loads
$grid.imagesLoaded().progress( function() {
$grid.isotope('layout');
});
});
</script>
<style>
.gv-diy-container h3 { padding: .5em 0; margin: 0; }
.gv-diy-container p { padding-top: 0; margin-bottom: 2em; }
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment