Giter Club home page Giter Club logo

masonry's Introduction

Masonry

A JS library built for quickly distributing 'tiles' of random sizes onto a given container in a Masonry layout

EXAMPLES: http://figdes3.surge.sh

download and try the simple demo!

Initialize:

const a = new Masonry(<html elem>, <distribution setting ('center', 'left', 'top')>, <resolution setting (int)>);

In order to create a new Masonry object, simply set a variable to 'new Masonry()'. The first argument is an HTML element. This element will be the container for the actual Masonry display. The second argument is a distribution. It has three possible values: "center" (default), "left", and "top". These control how the tiles will be stacked. The third argument is the resolution (default 32). This controls the amount of rows the Masonry container will be divided into. Increase it to get smaller tiles.

Methods:

app.placeTilesByClass("class")

This will grab all elements of the given class name and display them inside the Masonry as randomly-sized tiles. The size of these placed tiles can be controlled by the addition of a 'height' and/or 'width' attribute in the html element, which takes integers

app.placeGeneratedTile(["classname", "classname"],"style attribute","html content")

This will create a new Tile and place it on the Masonry. The first argument is an array of class names to be added to each element, the second is the content of the style attribute, while the third is the html content of the future tile itself

masonry's People

Contributors

mfigurski80 avatar

Stargazers

 avatar

Watchers

 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.