Created
December 31, 2016 22:48
-
-
Save anonymous/422039e5a244f9381d386ab3607b0088 to your computer and use it in GitHub Desktop.
Isotope - packery gutter
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
<h1>Isotope - packery gutter</h1> | |
<div class="grid"> | |
<div class="grid-item grid-item--width2"></div> | |
<div class="grid-item grid-item--height2"></div> | |
<div class="grid-item"></div> | |
<div class="grid-item"></div> | |
<div class="grid-item grid-item--width2 grid-item--height2"></div> | |
<div class="grid-item grid-item--width2"></div> | |
<div class="grid-item grid-item--width2"></div> | |
<div class="grid-item grid-item--height2"></div> | |
<div class="grid-item"></div> | |
<div class="grid-item grid-item--width2"></div> | |
<div class="grid-item grid-item--height2"></div> | |
<div class="grid-item"></div> | |
<div class="grid-item"></div> | |
</div> |
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
// external js: isotope.pkgd.js, packery-mode.pkgd.js | |
$('.grid').isotope({ | |
layoutMode: 'packery', | |
itemSelector: '.grid-item', | |
packery: { | |
gutter: 20 | |
} | |
}); |
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="//cdnjs.cloudflare.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script> | |
<script src="//npmcdn.com/isotope-layout@3/dist/isotope.pkgd.js"></script> | |
<script src="//npmcdn.com/isotope-packery@2/packery-mode.pkgd.js"></script> |
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
* { box-sizing: border-box; } | |
body { font-family: sans-serif; } | |
/* ---- grid ---- */ | |
.grid { | |
background: #DDD; | |
max-width: 1200px; | |
} | |
/* clear fix */ | |
.grid:after { | |
content: ''; | |
display: block; | |
clear: both; | |
} | |
/* ---- .grid-item ---- */ | |
.grid-item { | |
float: left; | |
width: 100px; | |
height: 100px; | |
background: #0D8; | |
border: 2px solid #333; | |
border-color: hsla(0, 0%, 0%, 0.7); | |
} | |
.grid-item--width2 { width: 220px; } | |
.grid-item--height2 { height: 220px; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment