blob: 86956adf1def0ce5ac4ef7e198033c46484da7e9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
<!doctype html>
<meta charset=utf-8>
<!-- Our target div should be placed as if it were a child of the overflowing --
-- thing; this is simplest to accomplish by just having the overflowing thing --
-- absolutely positioned so the target div is placed as if it were not there -->
<div style="overflow: auto; height: 100px; width: 200px; position: absolute">
<div style="width: 400px; height: 10px"></div>
</div>
<div id="target">Modified text</div>
<script>
document.querySelector("div").scrollLeft = 1000;
</script>
|