<!DOCTYPE html> | |
<style> | |
#scroller { | |
background: gray local; | |
border: 10px solid green; | |
overflow: scroll; | |
width: 200px; | |
height: 200px; | |
will-change: transform; | |
} | |
#spacer { | |
height: 500px; | |
} | |
</style> | |
<div id="scroller"> | |
<div id="spacer"></div> | |
<p>Text content</p> | |
</div> | |
<script> | |
onload = function() { | |
scroller.scrollTop = 500; | |
} | |
</script> |