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

Skip to content

Commit 9f522a0

Browse files
committed
notes about IE8 support
1 parent 56e147b commit 9f522a0

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ Inspired by [gridster.js](http://gridster.net). Built with love.
4747
- [Change grid width](#change-grid-width)
4848
- [Load grid from array](#load-grid-from-array)
4949
- [Override resizable/draggable options](#override-resizabledraggable-options)
50+
- [IE8 support](#ie8-support)
5051
- [Changes](#changes)
5152
- [v0.2.3 (development version)](#v023-development-version)
5253
- [v0.2.2 (2014-12-23)](#v022-2014-12-23)
@@ -511,6 +512,51 @@ $('.grid-stack').gridstack({
511512

512513
Note: It's not recommended to enable `nw`, `n`, `ne` resizing handles. Their behaviour may be unexpected.
513514

515+
## IE8 support
516+
517+
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
518+
CSS stylesheet dynamically. As a workaround you can do following:
519+
520+
- Create `gridstack-ie8.css` for your configuration (sample for grid with cell height of 60px can be found [here](https://gist.github.com/troolee/6edfea5857f4cd73e6f1)).
521+
- Include this CSS:
522+
523+
```html
524+
<!--[if lt IE 9]>
525+
<link rel="stylesheet" href="gridstack-ie8.css"/>
526+
<![endif]-->
527+
```
528+
529+
- You can use this python script to generate such kind of CSS:
530+
531+
```python
532+
#!/usr/bin/env python
533+
534+
height = 60
535+
margin = 20
536+
N = 100
537+
538+
print '.grid-stack > .grid-stack-item { min-height: %(height)spx }' % {'height': height}
539+
540+
for i in range(N):
541+
h = height * (i + 1) + margin * i
542+
print '.grid-stack > .grid-stack-item[data-gs-height="%(index)s"] { height: %(height)spx }' % {'index': i + 1, 'height': h}
543+
544+
for i in range(N):
545+
h = height * (i + 1) + margin * i
546+
print '.grid-stack > .grid-stack-item[data-gs-min-height="%(index)s"] { min-height: %(height)spx }' % {'index': i + 1, 'height': h}
547+
548+
for i in range(N):
549+
h = height * (i + 1) + margin * i
550+
print '.grid-stack > .grid-stack-item[data-gs-max-height="%(index)s"] { max-height: %(height)spx }' % {'index': i + 1, 'height': h}
551+
552+
for i in range(N):
553+
h = height * i + margin * i
554+
print '.grid-stack > .grid-stack-item[data-gs-y="%(index)s"] { top: %(height)spx }' % {'index': i , 'height': h}
555+
```
556+
557+
There are at least two more issues with gridstack in IE8 with jQueryUI resizable (it seems it doesn't work) and
558+
droppable. If you have any suggestions about support of IE8 you are welcome here: https://github.com/troolee/gridstack.js/issues/76
559+
514560

515561
Changes
516562
=======

0 commit comments

Comments
 (0)