Source code
Revision control
Copy as Markdown
Other Tools
<!DOCTYPE html>
<title>View transitions: scroller child element (ref)</title>
<link rel="author" href="mailto:vmpstr@chromium.org">
<style>
#target {
width: 200px;
height: 200px;
background: yellow;
}
#scroller {
overflow: scroll;
width: 100px;
height: 100px;
background: blue;
isolation: isolate;
}
#child {
position: absolute;
width: 100px;
height: 100px;
background: green;
top: 200px;
}
</style>
<div id="target">
<div id="scroller">
<div id="child"></div>
</div>
</div>
<script>
onload = () => { scroller.scrollTop = 300; };
</script>