Created
February 5, 2018 22:32
-
-
Save zackkatz/7e48220bd153b4f63a24ecb3ea147d6f to your computer and use it in GitHub Desktop.
GravityView DIY Layout - Add this to a Custom Content widget to look like the DIY Layout demo
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
<!-- Turn your DIY Layout into a "Isotope Masonry Layout", as seen on https://demo.gravityview.co/view/diy/ --> | |
<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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment