mirror of https://github.com/metafizzy/isotope
Filter & sort magical layouts
http://isotope.metafizzy.co
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
1.5 KiB
66 lines
1.5 KiB
--- |
|
title: Layout modes |
|
layout: demo |
|
category: demos |
|
related: layouts |
|
--- |
|
|
|
<section id="copy"> |
|
<p>Isotope has a versatile layout engine that can accommodate multiple layout modes. Vertical layouts react to changes in browser width. Horizontal layouts react to browser height.</p> |
|
<p>See <a href="../docs/layout-modes.html">docs on layout modes</a>.</p> |
|
</section> |
|
|
|
<section id="options" class="clearfix"> |
|
|
|
{% include layout-options.html %} |
|
|
|
</section> <!-- #options --> |
|
|
|
<div id="container" class="variable-sizes clearfix"> |
|
{% for element in site.elements limit:20 %} |
|
{% include element-partial.html %} |
|
{% endfor %} |
|
</div> <!-- #container --> |
|
|
|
{% include base-scripts.html %} |
|
<script> |
|
|
|
var $container = $('#container'); |
|
|
|
{% include layout-change.js %} |
|
|
|
{% include option-buttons.js %} |
|
|
|
$(function(){ |
|
|
|
// hacky way of adding random size classes |
|
$container.find('.element').each(function(){ |
|
if ( Math.random() > 0.6 ) { |
|
$(this).addClass('width2'); |
|
} |
|
if ( Math.random() > 0.6 ) { |
|
$(this).addClass('height2'); |
|
} |
|
}); |
|
|
|
$container.isotope({ |
|
itemSelector : '.element', |
|
masonry : { |
|
columnWidth : 120 |
|
}, |
|
masonryHorizontal : { |
|
rowHeight: 120 |
|
}, |
|
cellsByRow : { |
|
columnWidth : 240, |
|
rowHeight : 240 |
|
}, |
|
cellsByColumn : { |
|
columnWidth : 240, |
|
rowHeight : 240 |
|
} |
|
}); |
|
|
|
}); |
|
</script> |
|
|
|
|