| <!DOCTYPE html> |
| |
| <html> |
| <head> |
| <style> |
| body { |
| margin: 0; |
| height: 2000px; |
| overflow: hidden; /* hide scrollbars */ |
| } |
| |
| .group { |
| display: inline-block; |
| position: relative; |
| width: 250px; |
| height: 500px; |
| } |
| |
| .container { |
| -webkit-writing-mode: horizontal-bt; |
| width: 200px; |
| height: 400px; |
| border: 10px solid black; |
| padding: 5px; |
| } |
| |
| .box { |
| width: 200px; |
| height: 200px; |
| } |
| |
| .sticky { |
| position: -webkit-sticky; |
| top: 100px; |
| bottom: 100px; |
| background-color: green; |
| } |
| </style> |
| <script> |
| function doTest() |
| { |
| window.scrollTo(0, 100); |
| } |
| window.addEventListener('load', doTest, false); |
| </script> |
| </head> |
| <body> |
| <div class="group"> |
| <div class="container"> |
| <div class="sticky box"></div> |
| </div> |
| </div> |
| |
| <div class="group" style="top: 200px"> |
| <div class="container"> |
| <div class="sticky box"></div> |
| </div> |
| </div> |
| |
| <div class="group" style="top: 400px"> |
| <div class="container"> |
| <div class="sticky box"></div> |
| </div> |
| </div> |
| </body> |
| </html> |