OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script> |
| 3 if (window.internals) { |
| 4 internals.settings.setCSSStickyPositionEnabled(true); |
| 5 } |
| 6 </script> |
| 7 |
| 8 <html> |
| 9 <head> |
| 10 <style> |
| 11 body { |
| 12 margin: 0; |
| 13 height: 2000px; |
| 14 overflow: hidden; /* hide scrollbars */ |
| 15 } |
| 16 |
| 17 .group { |
| 18 display: inline-block; |
| 19 position: relative; |
| 20 width: 250px; |
| 21 height: 500px; |
| 22 } |
| 23 |
| 24 .container { |
| 25 -webkit-writing-mode: horizontal-bt; |
| 26 width: 200px; |
| 27 height: 400px; |
| 28 border: 10px solid black; |
| 29 padding: 5px; |
| 30 } |
| 31 |
| 32 .box { |
| 33 width: 200px; |
| 34 height: 200px; |
| 35 } |
| 36 |
| 37 .sticky { |
| 38 position: sticky; |
| 39 top: 100px; |
| 40 bottom: 100px; |
| 41 background-color: green; |
| 42 } |
| 43 </style> |
| 44 <script> |
| 45 function doTest() |
| 46 { |
| 47 window.scrollTo(0, 100); |
| 48 } |
| 49 window.addEventListener('load', doTest, false); |
| 50 </script> |
| 51 </head> |
| 52 <body> |
| 53 <div class="group"> |
| 54 <div class="container"> |
| 55 <div class="sticky box"></div> |
| 56 </div> |
| 57 </div> |
| 58 |
| 59 <div class="group" style="top: 200px"> |
| 60 <div class="container"> |
| 61 <div class="sticky box"></div> |
| 62 </div> |
| 63 </div> |
| 64 |
| 65 <div class="group" style="top: 400px"> |
| 66 <div class="container"> |
| 67 <div class="sticky box"></div> |
| 68 </div> |
| 69 </div> |
| 70 </body> |
| 71 </html> |
OLD | NEW |