Skip to content
This repository has been archived by the owner on Jun 9, 2018. It is now read-only.

alexdovzhanyn/resizeable.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub version Code Triagers Badge

Resizeable.js

Resizeable.js is a responsive library for easily creating grid layouts that work well on every device, without the need to re-organize the layout of the grid. It is (and always will be) free to use and open source under the GNU GENERAL PUBLIC LICENSE

Prerequisites

Resizeable uses the following open source projects to work properly:

  • jQuery - To easily manipulate the DOM

Installation

Resizeable requires jQuery to run.

Download the project files.

Copy the CSS and JS files into the appropriate directories, and load them (along with jQuery) in your HTML head.

<link rel="stylesheet" href="resizeable.css" type="text/css" />
<script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
<script src="resizeable.js"></script>

Create a div within your HTML where you'd like the grid to be, and pass in the resizeable.js options object...

<div class="resizeable-container" data-resizeable='{"gutter": 2, "columns": 4}'>
</div>

Add your first resizeable.js row:

<div class="resizeable-row">
</div>

Add content within the row, specifying how many columns each item should take up:

<div class="resizeable-row">
  <div class="resizeable-item col-2">
    &nbsp;
  </div>
  <div class="resizeable-item col-1">
    &nbsp;
  </div>
  <div class="resizeable-item col-1">
    &nbsp;
  </div>
</div>

Your full resizeable.js code should look something like this:

<!doctype html>
<html>
  <head>
    <link rel="stylesheet" href="resizeable.css" type="text/css" />
    <script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
    <script src="resizeable.js"></script>
  </head>
  <body>
    <div class="resizeable-container" data-resizeable='{"gutter": 2, "columns": 4}'>
      <div class="resizeable-row">
        <div class="resizeable-item col-2">
          &nbsp;
        </div>
        <div class="resizeable-item col-1">
          &nbsp;
        </div>
        <div class="resizeable-item col-1">
          &nbsp;
        </div>
      </div>
    </div>
  </body>
</html>

And thats it!

Todos

  • Make it work on all devices (it currently only works on medium and large screens)
  • Add Code Comments

License

GNU General Public License

Free Software, Hell Yeah!

About

A (small) javascript library for resizeable grid layouts that preserve their aspect ratio.

Resources

License

Stars

Watchers

Forks

Packages

No packages published