Coder Social home page Coder Social logo

icorradi / lightgrid Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eduardomb/lightgrid

0.0 2.0 0.0 91 KB

jQuery lightweight plugin to draw a grid based on (i) x, y coordinates and (ii) rows and cols dimensions for each element

HTML 16.47% JavaScript 83.53%

lightgrid's Introduction

Lightgrid

Usage Example

<div id="#my-grid">
  <div data-rows="1" data-cols="1" data-x="0" data-y="0">#1</div>
  <div data-rows="1" data-cols="2" data-x="0" data-y="1">#2</div>
  <div data-rows="2" data-cols="1" data-x="0" data-y="3">#3</div>
  <div data-rows="1" data-cols="3" data-x="1" data-y="0">#4</div>
</div>

<script type="text/javascript">
  $('#mygrid').lightgrid({'cols': 4})
</script>

The above example will generate a 4-column grid with the following format:

┌──────────────────┐
| #1 |   #2   |    |
|─────────────| #3 |
|      #4     |    |
└──────────────────┘

Default options

cols: 3            Number of columns
hSpacing: 10       Horizontal spacing from border to sep line
vSpacing: 10       Vertical spacing from element border to sep line
selector: div      Selector for elements in grid
aspectRatio        Number of times box height should be bigger than
                   width.
hBox               Overrides automatic box height calculation via
                   aspectRatio

lightgrid's People

Contributors

eduardomb avatar tadeurahian avatar

Watchers

James Cloos avatar Igor Corradi 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.