OLD | NEW |
(Empty) | |
| 1 <script> |
| 2 onload = function() { |
| 3 document.getElementById('scroller').scrollTop = 200; |
| 4 } |
| 5 </script> |
| 6 <style> |
| 7 #scroller { |
| 8 background: local grey; |
| 9 overflow: scroll; |
| 10 width: 200px; |
| 11 height: 200px; |
| 12 box-sizing: border-box; |
| 13 } |
| 14 |
| 15 #scroller-outline { |
| 16 will-change: transform; |
| 17 outline: 5px solid rgba(0, 255, 0, 0.5); |
| 18 outline-offset: -4px; |
| 19 position: absolute; |
| 20 width: 200px; |
| 21 height: 200px; |
| 22 } |
| 23 |
| 24 .spacer { |
| 25 height: 300px; |
| 26 } |
| 27 </style> |
| 28 <!-- #scroller outline should not be covered up by scrolling content background. |
| 29 It is achieved by painting the outline into the decoration layer which draws |
| 30 on top of all other layers. --> |
| 31 <div id="scroller-outline"></div> |
| 32 <div id="scroller"> |
| 33 <div class="spacer"></div> |
| 34 </div> |
| 35 |
OLD | NEW |