Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!doctype html>
<meta charset="utf-8">
<title>CSS Test: two scroll-marker-group with dynamic change</title>
<link rel="match" href="scroll-marker-group-009-ref.html">
<style>
div::scroll-marker-group {
display: flex;
height: 50px;
width: 100px;
}
div.scroll-marker-group-before {
overflow: auto;
scroll-marker-group: before;
}
div.scroll-marker-group-before::scroll-marker-group {
background: green;
}
div.scroll-marker-group-after {
overflow: auto;
scroll-marker-group: after;
}
div.scroll-marker-group-after::scroll-marker-group {
background: yellow;
}
</style>
<div id="target1"></div>
<div id="target2"></div>
<script>
document.documentElement.offsetTop;
target1.className = "scroll-marker-group-before";
target2.className = "scroll-marker-group-after";
document.documentElement.offsetTop;
target1.className = "scroll-marker-group-after";
document.documentElement.offsetTop;
target1.className = "";
document.documentElement.offsetTop;
target1.className = "scroll-marker-group-before";
target2.className = "";
document.documentElement.offsetTop;
target2.className = "scroll-marker-group-after";
document.documentElement.offsetTop;
target1.className = "scroll-marker-group-after";
target2.className = "scroll-marker-group-before";
</script>