Skip to content

Commit

Permalink
add Browserify docs
Browse files Browse the repository at this point in the history
  • Loading branch information
desandro committed Nov 21, 2014
1 parent d69d00f commit be2d683
Showing 1 changed file with 39 additions and 1 deletion.
40 changes: 39 additions & 1 deletion _content/appendix.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"Submitting issues",
"Upgrading from v2",
"RequireJS",
"Browserify",
"Extra examples",
"Additional resources"
]
Expand Down Expand Up @@ -201,7 +202,7 @@ <h2 id="requirejs">RequireJS</h2>
});
```

<p id="requirejs-pkgd-jquery">To use Masonry as a jQuery plugin with RequireJS and masonry.pkgd.js, you need to run jQuery bridget.</p>
<p id="requirejs-pkgd-jquery">To use Masonry as a jQuery plugin with RequireJS and masonry.pkgd.js, you need to use jQuery Bridget.</p>


``` js
Expand Down Expand Up @@ -263,6 +264,43 @@ <h2 id="requirejs">RequireJS</h2>

</div><div class="primary-content">

<h2 id="browserify">Browserify</h2>

<p>Masonry works with <a href="http://browserify.org">Browserify</a>. <a href="https://www.npmjs.org/package/masonry-layout">Install Masonry with npm</a>.</p>

```
npm install masonry-layout
```

``` js
var Masonry = require('masonry-layout');

var msnry = new Masonry( '#container', {
// options...
});
```

<p id="browserify-jquery">To use Masonry as a jQuery plugin with Browserify, you need to use <a href="https://www.npmjs.org/package/jquery-bridget">jQuery Bridget</a></p>

```
npm install jquery
npm install jquery-bridget
```

``` js
var $ = require('jquery');
var jQBridget = require('jquery-bridget');
var Masonry = require('../../masonry');
// make Masonry a jQuery plugin
$.bridget( 'masonry', Masonry );
// now you can use $().masonry()
$('#basic').masonry({
columnWidth: 60
});
```

</div><div class="primary-content">

<h2 id="extra-examples">Extra examples</h2>

<ul>
Expand Down

0 comments on commit be2d683

Please sign in to comment.