Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0562206

Browse files
committed
base usage section
1 parent 4544637 commit 0562206

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,25 @@ Usage
2424

2525
Coming soon...
2626

27+
## Basic usage
28+
29+
```html
30+
<div class="grid-stack">
31+
<div class="grid-stack-item" data-gs-x="0" data-gs-y="0" data-gs-width="4" data-gs-height="2"><div class="grid-stack-item-content"></div></div>
32+
<div class="grid-stack-item" data-gs-x="4" data-gs-y="0" data-gs-width="4" data-gs-height="4"><div class="grid-stack-item-content"></div></div>
33+
</div>
34+
35+
<script type="text/javascript">
36+
$(function () {
37+
var options = {
38+
cell_height: 80,
39+
vertical_margin: 10
40+
};
41+
$('.grid-stack).gridstack(options);
42+
});
43+
</script>
44+
```
45+
2746
## Options
2847
2948
- `width` - amount of columns (default: 12)
@@ -35,6 +54,10 @@ Coming soon...
3554
- `auto` - if `false` it tells to do not initialize existing items (default: true)
3655
- `min_width` - minimal width. If window width is less grid will be shown in one-column mode (default: 768)
3756
57+
## Grid attributes
58+
59+
- `data-gs-width` - grid width
60+
3861
## Item attributes
3962
4063
- `data-gs-x`, `data-gs-y` - element position

0 commit comments

Comments
 (0)