A Pen by David DeSandro on CodePen.
Last active
August 29, 2015 14:27
-
-
Save ActualAl/27d769417a9f9a6de71b to your computer and use it in GitHub Desktop.
Isotope - masonry layout mode
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 - masonry layout mode</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 | |
$(document).ready( function() { | |
$('.grid').isotope({ | |
itemSelector: '.grid-item', | |
masonry: { | |
columnWidth: 100 | |
} | |
}); | |
}); |
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.1.3/jquery.min.js"></script> | |
<script src="http://isotope.metafizzy.co/isotope.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
* { | |
-webkit-box-sizing: border-box; | |
-moz-box-sizing: border-box; | |
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: 200px; } | |
.grid-item--height2 { height: 200px; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment