---
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 docs on < a href = "../docs/layout-modes.html" > 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_ordered limit:20 %}
{% include element-partial.html %}
{% endfor %}
< / div > <!-- #container -->
< script src = "../js/jquery-1.4.4.min.js" > < / script >
< script src = "../src/mini-modernizr.js" > < / script >
< script src = "../src/jquery.opto-transform.js" > < / script >
< script src = "../src/jquery.smartresize.js" > < / script >
< script src = "../src/jquery.isotope.js" > < / script >
< script src = "../src/jquery.ui.widget.js" > < / script >
< script >
$(function(){
var $container = $('#container');
// 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
},
animationEngine : $.browser.opera ? 'jquery' : 'best-available',
});
{% include layout-change.js %}
{% include option-buttons.js %}
});
< / script >