Permalink
Browse files

Update README.md

  • Loading branch information...
e-oj committed Jan 3, 2019
1 parent cd17f7b commit 3df022b8a28bebb222905e3aeab3e9366a6f0fa4
Showing with 5 additions and 5 deletions.
  1. +5 −5 README.md
@@ -77,7 +77,7 @@ magicGrid.listen();
If your container doesn't have any dynamically loaded content i.e., all its child elements are always in the DOM, you should initialize the grid this way:
```javascript
let magicGrid = new MagicGrid({
container: "#container", // Required. Can be class, id selector or HTMLElement.
container: "#container", // Required. Can be a class, id, or an HTMLElement.
static: true, // Required for static content.
animate: true, // Optional.
});
@@ -89,7 +89,7 @@ magicGrid.listen();
If the container relies on data from an api, or experiences a delay, for whatever reason, before it can render its content in the DOM, you need to let the grid know the number of items to expect:
```javascript
let magicGrid = new MagicGrid({
container: "#container", // Required. Can be class, id selector or HTMLElement.
container: "#container", // Required. Can be a class, id, or an HTMLElement.
items: 20, // For a grid with 20 items. Required for dynamic content.
animate: true, // Optional.
});
@@ -105,7 +105,7 @@ magicGrid.listen();
The MagicGrid constructor. Initializes the grid with a configuration object.
```javascript
let magicGrid = new MagicGrid({
container: "#container", // Required. Can be class or id of the container or HTMLElement.
container: "#container", // Required. Can be a class, id, or an HTMLElement
static: false, // Required for static content. Default: false.
items: 30, // Required for dynamic content. Initial number of items in the container.
gutter: 30, // Optional. Space between items. Default: 25(px).
@@ -121,7 +121,7 @@ let magicGrid = new MagicGrid({
Positions the items and listens for changes to the window size. All items are repositioned whenever the window is resized.
```javascript
let magicGrid = new MagicGrid({
container: "#container", // Required. Can be class, id selector or HTMLElement.
container: "#container", // Required. Can be a class, id, or an HTMLElement
static: true, // Required for static content.
animate: true, // Optional.
});
@@ -136,7 +136,7 @@ This function is useful in cases where you have to manually trigger a reposition

```javascript
let magicGrid = new MagicGrid({
container: "#container", // Required. Can be class, id selector or HTMLElement
container: "#container", // Required. Can be a class, id, or an HTMLElement
items: 30, // Required for dynamic content.
animate: true, // Optional
});

0 comments on commit 3df022b

Please sign in to comment.