Newer
Older
minerva / Tests / LibWeb / Ref / abspos-escapes-scroll-container.html
@minerva minerva on 13 Jul 718 bytes Initial commit
<!DOCTYPE html>
<link rel="match" href="reference/abspos-escapes-scroll-container-ref.html" />
<style>
#scrollable-box {
    width: 300px;
    height: 200px;
    overflow: auto;
    border: 1px solid black;
    scrollbar-width: none;
}
.content {
    height: 600px;
}
.absolute-element {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: yellow;
}
</style>
<div id="scrollable-box">
    <div class="content"><span><span>Content that makes the container scrollable...</span></span></div>
    <div class="absolute-element">
        Abspos Element
    </div>
</div>
<script>
    const scrollContainer = document.getElementById("scrollable-box");
    scrollContainer.scrollTop = 500;
</script>