An open API service indexing awesome lists of open source software.

https://github.com/metafizzy/packery

:bento: Gapless, draggable grid layouts
https://github.com/metafizzy/packery

Last synced: about 2 months ago
JSON representation

:bento: Gapless, draggable grid layouts

Awesome Lists containing this project

README

        

# Packery

_Bin-packing layout library_

See [packery.metafizzy.co](https://packery.metafizzy.co) for complete docs and demos

## Install

### Download

+ [packery.pkgd.js](https://unpkg.com/packery@3/dist/packery.pkgd.js) un-minified, or
+ [packery.pkgd.min.js](https://unpkg.com/packery@3/dist/packery.pkgd.min.js) minified

### CDN

Link directly to Packery files on [unpkg](https://unpkg.com).

``` html

```

### Package managers

[npm](https://www.npmjs.com/package/packery): `npm install packery --save`

Bower: `bower install packery --save`

## License

Packery v3 is licensed under the MIT license.

## Initialize

With jQuery

``` js
$('.grid').packery({
// options...
itemSelector: '.grid-item'
});
```

With vanilla JavaScript

``` js
// vanilla JS
var grid = document.querySelector('.grid');
// initialize with element
var pckry = new Packery( grid, {
// options...
itemSelector: '.grid-item'
});

// initialize with selector string
var pckry = new Packery('.grid', {
// options...
});
```

With HTML

Add a `data-packery` attribute to your element. Options can be set in JSON in the value.

``` html




...

```

---

By [Metafizzy](http://metafizzy.co)