Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <style> | |
| 3 body { | |
| 4 height: 2000px; | |
| 5 margin: 0; | |
| 6 } | |
| 7 .sticky { | |
| 8 background: red; | |
| 9 height: 100px; | |
| 10 width: 100px; | |
| 11 overflow: hidden; | |
| 12 position: relative; | |
| 13 top: 100px; | |
| 14 } | |
| 15 .relative { | |
| 16 background: green; | |
| 17 height: 100px; | |
| 18 width: 100px; | |
| 19 position: relative; | |
| 20 } | |
| 21 #scroller { | |
| 22 left: 200px; | |
| 23 top: 100px; | |
| 24 height: 100px; | |
| 25 width: 120px; | |
| 26 overflow: auto; | |
| 27 position: absolute; | |
| 28 } | |
| 29 .spacer { | |
| 30 height: 1000px; | |
| 31 } | |
| 32 </style> | |
| 33 <script> | |
| 34 function doTest() { | |
| 35 window.scrollTo(0, 100); | |
| 36 document.getElementById('scroller').scrollTop = 100; | |
| 37 } | |
| 38 window.addEventListener('load', doTest, false); | |
| 39 </script> | |
| 40 <div class="sticky"> | |
| 41 <div class="relative"> | |
| 42 </div> | |
| 43 </div> | |
| 44 <div id="scroller"> | |
| 45 <div class="sticky"> | |
| 46 <div class="relative"> | |
|
chrishtr
2016/06/06 22:18:39
Was the bug that it wasn't including the bounds of
flackr
2016/06/09 17:13:32
Because the relative positioned element is clipped
| |
| 47 </div> | |
| 48 </div> | |
| 49 <div class="spacer"></div> | |
| 50 </div> | |
| 51 | |
| OLD | NEW |