Giter Site home page Giter Site logo

moomasonry's Introduction

mooMasonry

mooMasonry is a layout plugin for Mootools. Think of it as the flip side of CSS floats. Whereas floating arranges elements horizontally then vertically, mooMasonry arranges elements vertically then horizontally according to a grid. The result minimizes vertical gaps between elements of varying height, just like a mason fitting stones in a wall.

Screenshot

Comparison Example

CSS Floats Screenshot

mooMasonry Screenshot

How to use

HTML code:

<div id="primary">
	<div class="box col2">...</div>
	<div class="box col1">...</div>
	<div class="box col1">...</div>
	<div class="box col3">...</div>
	<div>
    	<div class="box col1">...</div>
    	<div class="box col2">...</div>
    	<div class="box col3">...</div>
	</div>
</div>

JS sample:

document.id('primary').masonry({
    columnWidth: 100, 
    itemSelector: '.box' 
});

Docs

Options:

document.id('wrapper').masonry({

	singleMode: false,
	// Disables measuring the width of each floated element.
	// Set to true if floated elements have the same width.
	// default: false

	columnWidth: 240,
	// Width in pixels of 1 column of your grid.
	// default: outer width of the first floated element.

	itemSelector: '.box:visible',
	// Additional selector to specify which elements inside
	// the wrapping element will be rearranged.
	// Required for Infinite Scroll with window resizing.

	resizeable: true,
	// Binds a mooMasonry call to window resizes.
	// default: true

	appendedContent: '.new_content',
	// Additional container element for appended content.
	// Useful for Infinite Scroll integration.

});

Events:

masoned(container): 
	Fires when masonry of the container is complete. contrainer is the wrapper who just got masoned.

Methods:

Element.masonry(options): 
	Masons the element (which should be a wrapper) with the given options

moomasonry's People

Contributors

delapouite avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.