|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | +<head> |
| 4 | + <meta charset="utf-8"> |
| 5 | + <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| 6 | + <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 7 | + <link rel="stylesheet" href="../../../demo/demo.css"/> |
| 8 | + <!-- <script src="https://cdn.jsdelivr.net/npm/gridstack@3.3.0/dist/gridstack-h5.js"></script> --> |
| 9 | + <script src="../../../dist/gridstack-h5.js"></script> |
| 10 | + <style> |
| 11 | + .topHeader { |
| 12 | + background: rgb(127, 87, 180); |
| 13 | + height: 200px; |
| 14 | + } |
| 15 | + .willScroll { |
| 16 | + height: 600px; |
| 17 | + overflow-y: auto; |
| 18 | + flex-grow: 1; |
| 19 | + } |
| 20 | + .row { |
| 21 | + display:flex; |
| 22 | + width: 100%; |
| 23 | + } |
| 24 | + .showDistance { |
| 25 | + border-top-width: 130px; |
| 26 | + border-bottom-width: 130px; |
| 27 | + border-color: gray; |
| 28 | + border-style: solid; |
| 29 | + height: 600px; |
| 30 | + width: 50px; |
| 31 | + box-sizing: border-box; |
| 32 | + } |
| 33 | + </style> |
| 34 | + |
| 35 | +</head> |
| 36 | +<body> |
| 37 | + <div class="topHeader">This is the header which brings an offset of 200 px</div> |
| 38 | + <div class="row"> |
| 39 | + <div class="showDistance"></div> |
| 40 | + <div class="willScroll"> |
| 41 | + <div class="grid-stack"></div> |
| 42 | + </div> |
| 43 | + </div> |
| 44 | + |
| 45 | + <script type="text/javascript"> |
| 46 | + let grid = GridStack.init({cellHeight: 130}); |
| 47 | + let items = [ |
| 48 | + {x: 0, y: 0, w: 2, h: 2, content: "resize-me - check scrolling starts only when in height of gray area, and you can scroll back up as well."}, |
| 49 | + {x: 3, y: 0, w: 2, h: 2, content: "this is here to have next item positioned way down"}, |
| 50 | + {x: 3, y: 2, w: 3, h: 2, content: "resize me - scroll will start immediately, but should not be extremely fast"}, |
| 51 | + {x: 6, y: 0, w: 2, h: 8, content: "this is here to have a scroll bar from the beginning"}, |
| 52 | + ]; |
| 53 | + grid.load(items); |
| 54 | + </script> |
| 55 | +</body> |
| 56 | +</html> |
0 commit comments