A small, lightweight JavaScript plugin for placing items in straight rows
npm install rowgrid.jsThe grid is similar to grids on Google Image Search, flickr, shutterstock and Google+ images.
Features:
* responsive
* infinite scrolling
* support for all modern browsers and IE >= 8
A vanilla JavaScript version is available that doesn't require jQuery: https://github.com/brunjo/rowGrid
![Example Grid][2]
Do you like this project? Follow me on Twitter [@3runjo][1].
Real world example: https://www.pexels.com/
HTML
`You can install it also with Bower or npm:
* Install with Bower:
bower install rowGrid.js.
* Install with npm: npm install rowgrid.js.Usage
It is important that you either declare the width and height as attributes on the img tag or that you wait until the images are loaded before you start rowGrid.js.HTML:
`HTML


...
`
JS:
`JS
var options = {minMargin: 10, maxMargin: 35, itemSelector: ".item"};
$(".container").rowGrid(options);
`$3
JS:
`JS
// append new items
$(".container").append("
");
// arrange appended items
$(".container").rowGrid("appended");
`Options
`JS
$(".container").rowGrid({
itemSelector: ".item"
minMargin: 10,
maxMargin: 35,
resize: true,
lastRowClass: "last-row",
firstItemClass: "first-item"
});
`
#### itemSelector (required)
* value: `string` (CSS Selector)You have to set this option. The selector have to reference to all grid items.
#### minMargin
* value:
`number` or `null`
* default value: `null`This is the minimal horizontal margin between the items. The margin is only between the items not between the first/last item and the container.
#### maxMargin
* value:
`number` or `null`
* default value: `null`This is the maximal horizontal margin between the items.
#### resize
* value:
`boolean`
* default value: `true`If
`resize` is set to true the layout updates on resize events. This is useful for responsive websites.
#### lastRowClass
* value: `string`
* default value: `last-row`The first item in the last row gets this class.
#### firstItemClass
* value:
`string` or `null`
* default value: `null`The first item in every row gets this class.
#### lastItemClass
* value:
`string` or `null`
* default value: `null``The last item in every row gets this class.
[1]: https://twitter.com/3runjo "@3runjo"
[2]: http://brunjo.github.io/rowGrid.js/ "Demos"