Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <style> | |
| 3 body { | |
| 4 margin: 0px; | |
| 5 } | |
| 6 | |
| 7 .scroller { | |
| 8 overflow: scroll; | |
| 9 width: 200px; | |
| 10 height: 600px; | |
| 11 } | |
| 12 | |
| 13 .box { | |
| 14 background: rgba(0, 255, 0, 0.9); | |
| 15 position: relative; | |
| 16 width: 185px; | |
| 17 height: 50px; | |
| 18 top: 20px; | |
| 19 } | |
| 20 | |
| 21 .indicator { | |
| 22 position: absolute; | |
| 23 width: 185px; | |
| 24 height: 50px; | |
| 25 background: red; /* covered up by .box when working */ | |
| 26 } | |
| 27 | |
| 28 .container { | |
| 29 width: 100%; | |
| 30 height: 1000px; | |
| 31 background: grey; | |
| 32 } | |
| 33 </style> | |
| 34 | |
| 35 <div id="scroller" class="scroller"> | |
| 36 <div class="container"> | |
| 37 <div class="indicator"></div> | |
| 38 <div class="box"></div> | |
| 39 </div> | |
| 40 </div> | |
| 41 | |
| 42 <script> | |
| 43 let scroller = document.getElementById('scroller'); | |
| 44 scroller.scrollTop = 20; | |
| 45 </script> | |
| OLD | NEW |