All Projects → johansatge → Elastic Columns

johansatge / Elastic Columns

Licence: mit
A jQuery plugin designed to be used as an alternative to the well-known Isotope library.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Elastic Columns

Gijgo
Gijgo - Free Javascript Controls
Stars: ✭ 424 (+987.18%)
Mutual labels:  jquery-plugin, grid, jquery
Bs grid
Bootstrap Datagrid
Stars: ✭ 184 (+371.79%)
Mutual labels:  jquery-plugin, grid, jquery
Ax5ui Grid
Javascript UI Component - GRID ( Excel Grid, jqGrid, angularjs grid, jquery grid, SlickGrid, ag-grid gridify)
Stars: ✭ 102 (+161.54%)
Mutual labels:  jquery-plugin, grid, jquery
Rowgrid.js
A small, lightweight JavaScript plugin for placing items in straight rows (jQuery and vanilla JS version) – Demo:
Stars: ✭ 670 (+1617.95%)
Mutual labels:  jquery-plugin, grid, jquery
Printthis
jQuery printing plugin; print specific elements on a page
Stars: ✭ 902 (+2212.82%)
Mutual labels:  jquery-plugin, jquery
Jquery.tabslideout.js
jQuery plugin to create a side/top/bottom tab that slides out to show a feedback form, contact form, notepad etc.
Stars: ✭ 35 (-10.26%)
Mutual labels:  jquery-plugin, jquery
Bootstrap Show Modal
A Bootstrap 4 / jQuery plugin wrapper, to create modals dynamically in JavaScript
Stars: ✭ 38 (-2.56%)
Mutual labels:  jquery-plugin, jquery
Jquery.marquee
jQuery plugin to scroll the text like the old traditional marquee
Stars: ✭ 857 (+2097.44%)
Mutual labels:  jquery-plugin, jquery
Trip.js
🚀 Trip.js is a plugin that can help you customize a tutorial trip easily with more flexibilities.
Stars: ✭ 789 (+1923.08%)
Mutual labels:  jquery-plugin, jquery
Inputtounsi
A jQuery plugin for entering and validating Tunisian users' data or any other data. It is made very easy to use and easier to customize
Stars: ✭ 25 (-35.9%)
Mutual labels:  jquery-plugin, jquery
Bootstrap Msg
The jQuery plugin for showing message with Bootstrap alert classes
Stars: ✭ 10 (-74.36%)
Mutual labels:  jquery-plugin, jquery
Push State
Turn static web sites into dynamic web apps.
Stars: ✭ 16 (-58.97%)
Mutual labels:  jquery-plugin, jquery
Jquery Powertip
💬 A jQuery plugin that creates hover tooltips.
Stars: ✭ 822 (+2007.69%)
Mutual labels:  jquery-plugin, jquery
Jquery Datetextentry
jQuery plugin providing a widget for date entry (not a date picker)
Stars: ✭ 19 (-51.28%)
Mutual labels:  jquery-plugin, jquery
Jquery Rslitegrid
Input tabular data with your keyboard
Stars: ✭ 5 (-87.18%)
Mutual labels:  grid, jquery
Cz Parallax
Simple and tiny jQuery plugin for Parallax effect.
Stars: ✭ 10 (-74.36%)
Mutual labels:  jquery-plugin, jquery
Viewer
⚠️ [Deprecated] No longer maintained, please use https://github.com/fengyuanchen/jquery-viewer
Stars: ✭ 985 (+2425.64%)
Mutual labels:  jquery-plugin, jquery
Framecarousel
A jQuery plugin for quickly creating carousels within frames
Stars: ✭ 14 (-64.1%)
Mutual labels:  jquery-plugin, jquery
Sticky Nav
A jQuery plugin make the navbar sticky, smart anchor link highlighting, smooth scrolling. Simple and powerful.
Stars: ✭ 21 (-46.15%)
Mutual labels:  jquery-plugin, jquery
Gridstrap.js
gridstrap.js is a jQuery plugin designed to take Bootstrap's CSS grid system and turn it into a managed draggable and resizeable grid while truely maintaining its responsive behaviour.
Stars: ✭ 32 (-17.95%)
Mutual labels:  jquery-plugin, jquery

Bower

Elastic Columns

A jQuery plugin designed to be used as an alternative to the well-known Isotope library - View demo.


Why

I wanted to make a simple alternative to Isotope or Masonry - those modules work very well, but can be oversized on some cases.

Elastic Columns is lightweight (less than 3kb) and will suit your needs if you have to build a grid of items using columns with equal widths.

Installation

With Bower:

bower install elastic-columns

Alternatively, checkout the project and install the minified script whenever you want in your project.

Basic usage

This code will set the position of the children nodes in your container.

var $container = $('.container');
$container.elasticColumns(
{
    columns:        3,  // the number of colums
    innerMargin:    10, // the gap between two tiles
    outerMargin:    20  // the gap between the tiles and
                        // the edge of the container
});

This inits the grid once, and then does nothing.

If your container is fluid (i.e. its width can change), you have to set the right number of columns by yourself, like in the example below:

$(window).on('resize', function(evt)
{
    // Here, we want 4 columns if the size of the window is greater than 800px, 3 columns otherwise
    var columns = $container.width() > 800 ? 4 : 3;
    $container.elasticColumns('set', 'columns', columns);
    $container.elasticColumns('refresh');
});

API

Refreshing the layout

You may want to refresh the layout when the user resizes the window, or when you add new items to the grid (by appending nodes to your container).

$('.container').elasticColumns('refresh');

If you append pictures, be sure to wait for them to be loaded before refreshing the layout, or the calculations may be false.

Modifying settings on the fly

You can change the plugin settings at any time.

$('.container').elasticColumns('set', 'columns', 4);
$('.container').elasticColumns('set', 'innerMargin', 5);
$('.container').elasticColumns('set', 'outerMargin', 10);

When you are updating a parameter, don't forget to refresh the grid.

Destroying the layout

You can restore the layout to its initial state.

$('.container').elasticColumns('destroy');

Ignoring items

You may add the elastic-columns-ignore class to some items if you don't want them to be positioned on the grid. This can be useful if you are filtering the grid content and don't want to remove items on the fly.

<div class="item elastic-columns-ignore"></div>

Changelog

Version Date Notes
0.2.1 August 17th, 2015 Adds logo and new demo page
0.2.0 August 17th, 2015 Adds demo files in the main branch
0.1.1 July 26th, 2014 Adds a method to remove the styles set by the plugin.
0.1 January 29th, 2014 Initial version

License

This project is released under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].