| OLD | NEW |
| (Empty) | |
| 1 <style> |
| 2 body { |
| 3 margin: 0; |
| 4 } |
| 5 |
| 6 .scroller { |
| 7 overflow: hidden; /* hide scrollbars */ |
| 8 width: 200px; |
| 9 height: 500px; |
| 10 outline: 2px solid black; |
| 11 } |
| 12 |
| 13 .container { |
| 14 width: 200px; |
| 15 height: 1000px; |
| 16 } |
| 17 |
| 18 .sticky { |
| 19 position: sticky; |
| 20 width: 200px; |
| 21 top: 0; |
| 22 } |
| 23 |
| 24 .first { |
| 25 height: 500px; |
| 26 background: red; |
| 27 } |
| 28 |
| 29 .second { |
| 30 height: 400px; |
| 31 background: green; |
| 32 } |
| 33 |
| 34 .third { |
| 35 height: 300px; |
| 36 background: blue; |
| 37 top: 100px; |
| 38 } |
| 39 |
| 40 .fourth { |
| 41 height: 200px; |
| 42 background: pink; |
| 43 top: 100px; |
| 44 } |
| 45 |
| 46 .fifth { |
| 47 height: 100px; |
| 48 background: yellow; |
| 49 } |
| 50 </style> |
| 51 |
| 52 <script> |
| 53 if (window.testRunner) |
| 54 testRunner.waitUntilDone(); |
| 55 |
| 56 function finishTest() { |
| 57 document.querySelector('.scroller').scrollTop = 400; |
| 58 if (window.testRunner) |
| 59 testRunner.notifyDone(); |
| 60 } |
| 61 |
| 62 window.addEventListener('load', function() { |
| 63 requestAnimationFrame(function() { |
| 64 requestAnimationFrame(finishTest); |
| 65 }); |
| 66 }); |
| 67 </script> |
| 68 |
| 69 <div class="scroller"> |
| 70 <div class="container"> |
| 71 <div class="first sticky"> |
| 72 <div class="second sticky"> |
| 73 <div class="third sticky"> |
| 74 <div class="fourth sticky"> |
| 75 <div class="fifth sticky"></div> |
| 76 </div> |
| 77 </div> |
| 78 </div> |
| 79 </div> |
| 80 </div> |
| 81 </div> |
| OLD | NEW |