Skip to content

Instantly share code, notes, and snippets.

@rockwotj
Last active August 25, 2022 16:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rockwotj/c6b7a8308729ce07d8cbfec10f21bd90 to your computer and use it in GitHub Desktop.
Save rockwotj/c6b7a8308729ce07d8cbfec10f21bd90 to your computer and use it in GitHub Desktop.
Reverse scroll test
<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">
#root {
display:flex;
flex-direction: column-reverse;
overflow-y: scroll;
height: 300px;
}
#root > * {
height: 50px;
background: orange;
flex-shrink: 0;
}
#root > :nth-child(even) {
background: pink;
}
</style>
</head>
<body>
<div id="root">
</div>
<script type="text/javascript">
let i = 0;
setInterval(() => {
let e = document.createElement("div")
e.prepend((++i).toString())
root.prepend(e)
}, 1000);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment