Coder Social home page Coder Social logo

jquery-layout's Introduction

jquery-layout

A simple interface for common layout tasks.

Basic Usage

<div class="container">
  <div data-value="10"></div>
  <div data-value="10"></div>
  <div data-value="30"></div>
  <div data-value="40"></div>
  <div data-value="30"></div>
  <div data-value="20"></div>
  <div data-value="20"></div>
  <div data-value="10"></div>
  <div data-value="40"></div>
</div>
$('.container > div').layout({
  align: 'top left', 
  sort: 'value', 
  order: 'desc', 
  stack: {
    sort: 'value', 
    offset: {
      top: 10, 
      left: 0
    }
  }
});

Options

OptionTypeDescription
align String A combination of alignment values, e.g. `middle 75%`. See `textAlign` and `verticalAlign`.
columns Number Specify the number of columns in each row. You can also provide a callback-function to calculate this value on the fly. Defaults to `0`.
order String Specifies the order of elements when a sort-function has been provided. One out of `asc` or `desc`. Defaults to `asc`.
sort Function Allows for sorting elements. When providing a string, a sort-function is auto-generated based on the value of a data-attribute. When providing an array of elements, a function is generated based on array index
stack Object Allows for stacking of elements. Provide an object with the following properties: `offset`, `sort`, `align`, `textAlign`, verticalAlign`. You can also provide a string containing alignment-values separated by whitespace. By default, stacking is based on the value of the sort-param. Alignment defaults to `bottom center`. You can specify an offset at which elements are stacked. Defaults to `auto` which means based on the element's height.
style String One out of `absolute`, `transform` or `none`. Defaults to `absolute`.
textAlign String One out of `left`, `center`, `bottom`. This value can also be specified as percent unit, e.g. `75%` or as a float, e.g. `0.75`.
verticalAlign String One out of `top`, `middle`, `bottom`. This value can also be specified as percent unit, e.g. `75%` or as a float, e.g. `0.75`.

jquery-layout's People

Contributors

rexblack 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.