| <!doctype html> |
| <style> |
| body { |
| margin: 0; |
| } |
| |
| .scroller { |
| height: 200px; |
| width: 100px; |
| overflow-y: scroll; |
| padding: 20px 0; |
| |
| /* Force compositing. */ |
| backface-visibility: hidden; |
| } |
| |
| .contents { |
| height: 500px; |
| width: 100%; |
| } |
| |
| .indicator { |
| height: 100px; |
| width: 100%; |
| background-color: green; |
| position: relative; |
| } |
| </style> |
| |
| <div class="scroller"> |
| <div class="contents"> |
| <div class="prepadding"></div> |
| <div class="container"> |
| <div class="filler"></div> |
| <div class="indicator" style="top: 250px"></div> |
| </div> |
| </div> |
| </div> |
| |
| <script> |
| window.addEventListener('load', function() { |
| document.querySelector('.scroller').scrollTop = 200; |
| }); |
| </script> |