MooColumns is a MooTools 1.2 class that allows you to divide content into multiple columns quickly and easily.
<link rel="stylesheet" href="css/mooColumns.css" type="text/css" media="all" /> ... <div class="multiColumn">Content Here</div> ... <script type="text/javascript" src="js/mootools-1.2-core-yc.js" ></script> <script type="text/javascript" src="js/MooColumns_0.66.js" ></script>
var myColumns = new MooColumns({/*options here*/});
// divide all elements with the multiColumn class into 2 columns
var myColumns = new MooColumns({});
// divide all elements with the multiColumn class into 3 columns
var TripleColumns = new MooColumns({ numOfColumns:3 });
// divide the element with the id of "article" into 4 columns
var moreColumns = new MooColumns({ selector:'#article', numOfColumns:3 });
// divide all elements with the multiColumn class into 3 columns
// but make the overall multiColumn area 10 pixels less wide
// and nudge it 10px to the left and 10px down
var myTweakedColumns = new MooColumns({
tweak:{
width:-10,
x:10,
y:10
},
numOfColumns:3
});
Column Breaks: MooColumns looks for either a span with the class of "colBreak" or two consecutive horiztonal rule elements to use as the column breaks.
Requirements: MooTools 1.2 Core.
Compatibility: All A-grade browsers..
The creation of a MooColumns instance must be wrapped in a domready event.
window.addEvent('domready', function() {
var myColumns = new MooColumns({});
});
| Download |