Created
December 19, 2018 23:06
-
-
Save zackkatz/a05669427e67fea772786e6da3149e6b to your computer and use it in GitHub Desktop.
GravityView Demo Site - DIY Layout Code
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
<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