Forked from David DeSandro's Pen Isotope - packery layout mode.
Created
September 26, 2014 19:04
-
-
Save isotrope/c294107e806cd2daa299 to your computer and use it in GitHub Desktop.
A Pen by isotrope.
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 layout mode</h1> | |
<div class="isotope"> | |
<div class="item width2 height2"></div> | |
<div class="item"></div> | |
<div class="item"></div> | |
<div class="item"></div> | |
<div class="item"></div> | |
<div class="item"></div> | |
<div class="item width2 height2"></div> | |
<div class="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: | |
// http://isotope.metafizzy.co/isotope.pkgd.js | |
// http://rawgit.com/metafizzy/isotope-packery/master/packery-mode.pkgd.js | |
$( function() { | |
$('.isotope').isotope({ | |
layoutMode: 'packery', | |
itemSelector: '.item' | |
}); | |
}); |
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; | |
} | |
/* ---- isotope ---- */ | |
.isotope { | |
background: #DDD; | |
max-width: 1200px; | |
} | |
/* clear fix */ | |
.isotope:after { | |
content: ''; | |
display: block; | |
clear: both; | |
} | |
/* ---- .item ---- */ | |
.item { | |
float: left; | |
width: 200px; | |
height: 200px; | |
background: #0D8; | |
border: 2px solid #333; | |
border-color: hsla(0, 0%, 0%, 0.7); | |
} | |
.item.width2 { width: 400px; } | |
.item.height2 { height: 400px; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment