You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*`Array.prototype.find` for IE and older browsers ([core.js](https://github.com/zloirock/core-js#ecmascript-6-array) allows to include specific polyfills)
48
+
*[jQuery](http://jquery.com) (>= 1.8)
49
+
*`Array.prototype.find`, and `Number.isNaN()` for IE and older browsers.
50
+
* Note: as of v0.5.4 We supply a separate `gridstack.poly.js` for that
51
+
(part of `gridstack.all.js`) or you can look at other pollyfills
52
+
([core.js](https://github.com/zloirock/core-js#ecmascript-6-array) and [mozilla.org](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)).
* Note: as of v0.5.4 we include this subset as `jquery-ui.js` (and min.js) which is part of `gridstack.all.js`. If you wish to bring your own lib, include the individual gridstack parts instead of all.js
57
58
* (Optional) [jquery-ui-touch-punch](https://github.com/furf/jquery-ui-touch-punch) for touch-based devices support
GridStack makes it very easy if you need [1-12] columns out of the box (default is 12), but you always need **2 things** if you need to customize this:
186
+
187
+
1) Change the `column` grid option when creating a grid to your number N
188
+
```js
189
+
$('.grid-stack').gridstack( {column:N} );
190
+
```
191
+
192
+
2) include `gridstack-extra.css` if **N < 12** (else custom CSS - see next). Without these, things will not render/work correctly.
To change grid width (columns count), to addition to `width` option, CSS rules
180
-
for `.grid-stack-item[data-gs-width="X"]` and `.grid-stack-item[data-gs-x="X"]` have to be changed accordingly.
196
+
<divclass="grid-stack grid-stack-N">...</div>
197
+
```
198
+
199
+
Note `grid-stack-N` class was added, and extra CSS.
200
+
201
+
`gridstack-extra.css` (and `gridstack-extra.min.css`) defines CSS for grids with custom [1-12] columns. Anything more and you'll need to generate the SASS/CSS yourself (see next).
202
+
203
+
See example: [2 grids demo](http://gridstack.github.io/gridstack.js/demo/two.html) with 6 columns
204
+
205
+
## Custom columns CSS
206
+
207
+
If you need > 12 columns or want to generate the CSS manually (else see above) you will need to generate CSS rules for `.grid-stack-item[data-gs-width="X"]` and `.grid-stack-item[data-gs-x="X"]`.
181
208
182
209
For instance for 3-column grid you need to rewrite CSS to be:
183
210
@@ -205,13 +232,15 @@ For 4-column grid it should be:
205
232
206
233
and so on.
207
234
208
-
Here is a SASS code snippet which can make life easier (Thanks to @ascendantofrain, [#81](https://github.com/gridstack/gridstack.js/issues/81) and @StefanM98, [#868](https://github.com/gridstack/gridstack.js/issues/868)):
235
+
Better yet, here is a SASS code snippet which can make life much easier (Thanks to @ascendantofrain, [#81](https://github.com/gridstack/gridstack.js/issues/81) and @StefanM98, [#868](https://github.com/gridstack/gridstack.js/issues/868)) and you can use sites like [sassmeister.com](https://www.sassmeister.com/) to generate the CSS for you instead:
@@ -221,25 +250,6 @@ Here is a SASS code snippet which can make life easier (Thanks to @ascendantofra
221
250
}
222
251
```
223
252
224
-
Or you can include `gridstack-extra.css`. See below for more details.
225
-
226
-
## Extra CSS
227
-
228
-
There are few extra CSS batteries in `gridstack-extra.css` (`gridstack-extra.min.css`).
229
-
230
-
### Different grid widths
231
-
232
-
You can use other than 12 grid width:
233
-
234
-
```html
235
-
<divclass="grid-stack grid-stack-N">...</div>
236
-
```
237
-
```javascript
238
-
$('.grid-stack').gridstack({width:N});
239
-
```
240
-
241
-
See example: [2 grids demo](http://gridstack.github.io/gridstack.js/demo/two.html)
242
-
243
253
## Override resizable/draggable options
244
254
245
255
You can override default `resizable`/`draggable` options. For instance to enable other then bottom right resizing handle
@@ -255,59 +265,6 @@ $('.grid-stack').gridstack({
255
265
256
266
Note: It's not recommended to enable `nw`, `n`, `ne` resizing handles. Their behaviour may be unexpected.
257
267
258
-
## IE8 support
259
-
260
-
Support of IE8 is quite limited and is not a goal at this time. As far as IE8 doesn't support DOM Level 2 I cannot manipulate with
261
-
CSS stylesheet dynamically. As a workaround you can do the following:
262
-
263
-
- Create `gridstack-ie8.css` for your configuration (sample for grid with cell height of 60px can be found [here](https://gist.github.com/gridstack/6edfea5857f4cd73e6f1)).
264
-
- Include this CSS:
265
-
266
-
```html
267
-
<!--[if lt IE 9]>
268
-
<link rel="stylesheet" href="gridstack-ie8.css"/>
269
-
<![endif]-->
270
-
```
271
-
272
-
- You can use this python script to generate such kind of CSS:
0 commit comments