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 width: 2000px; |
| 14 overflow: hidden; /* hide scrollbars */ |
| 15 } |
| 16 |
| 17 .container { |
| 18 position: absolute; |
| 19 width: 2000px; |
| 20 height: 180px; |
| 21 top: 350px; |
| 22 outline: 2px solid black; |
| 23 } |
| 24 |
| 25 .vertical.container { |
| 26 top: 0px; |
| 27 left: 350px; |
| 28 width: 180px; |
| 29 height: 2000px; |
| 30 } |
| 31 |
| 32 .box { |
| 33 width: 800px; |
| 34 height: 180px; |
| 35 } |
| 36 |
| 37 .vertical .box { |
| 38 width: 180px; |
| 39 height: 500px; |
| 40 } |
| 41 |
| 42 .sticky { |
| 43 position: sticky; |
| 44 left: 50px; |
| 45 right: 50px; |
| 46 background-color: green; |
| 47 } |
| 48 |
| 49 .vertical .sticky { |
| 50 left: 0; |
| 51 top: 50px; |
| 52 bottom: 50px; |
| 53 background-color: blue; |
| 54 opacity: 0.75; |
| 55 } |
| 56 </style> |
| 57 <script> |
| 58 function doTest() |
| 59 { |
| 60 window.scrollTo(300, 300); |
| 61 } |
| 62 window.addEventListener('load', doTest, false); |
| 63 </script> |
| 64 </head> |
| 65 <body> |
| 66 <div class="container"> |
| 67 <div class="sticky box"></div> |
| 68 </div> |
| 69 <div class="vertical container"> |
| 70 <div class="sticky box"></div> |
| 71 </div> |
| 72 |
| 73 </body> |
| 74 </html> |
OLD | NEW |