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 font-family: 'Ahem'; |
| 16 font-size: 24px; |
| 17 line-height: 2; |
| 18 } |
| 19 |
| 20 .group { |
| 21 display: inline-block; |
| 22 position: relative; |
| 23 width: 220px; |
| 24 height: 500px; |
| 25 } |
| 26 |
| 27 .container { |
| 28 width: 200px; |
| 29 height: 400px; |
| 30 outline: 2px solid black; |
| 31 } |
| 32 |
| 33 .box { |
| 34 width: 200px; |
| 35 height: 200px; |
| 36 } |
| 37 |
| 38 .sticky { |
| 39 width: 200px; |
| 40 height: 200px; |
| 41 color: blue; |
| 42 position: sticky; |
| 43 top: 100px; |
| 44 } |
| 45 |
| 46 .child { |
| 47 position: absolute; |
| 48 background-color: green; |
| 49 opacity: 0.8; |
| 50 top: 50px; |
| 51 left: 50px; |
| 52 } |
| 53 |
| 54 .indicator { |
| 55 display: none; |
| 56 position: absolute; |
| 57 top: 250px; |
| 58 left: 50px; |
| 59 background-color: red; |
| 60 } |
| 61 </style> |
| 62 <script> |
| 63 function doTest() |
| 64 { |
| 65 window.scrollTo(0, 100); |
| 66 } |
| 67 window.addEventListener('load', doTest, false); |
| 68 </script> |
| 69 </head> |
| 70 <body> |
| 71 <div class="group"> |
| 72 <div class="indicator box"></div> |
| 73 <div class="container"> |
| 74 XXX <span class="sticky">XXXX</br>XXXX</br>XXXX</br>XXXX</br>XXXX</s
pan> XXX |
| 75 </div> |
| 76 </div> |
| 77 <div class="group" style="top: 100px"> |
| 78 <div class="indicator box"></div> |
| 79 <div class="container"> |
| 80 XXX <span class="sticky">XXXX</br>XXXX</br>XXXX</br>XXXX</br>XXXX</s
pan> XXX |
| 81 </div> |
| 82 </div> |
| 83 <div class="group" style="top: 200px"> |
| 84 <div class="indicator box"></div> |
| 85 <div class="container"> |
| 86 XXX <span class="sticky">XXXX</br>XXXX</br>XXXX</br>XXXX</br>XXXX</s
pan> XXX |
| 87 </div> |
| 88 </div> |
| 89 |
| 90 </body> |
| 91 </html> |
OLD | NEW |