Last active
August 25, 2022 16:16
-
-
Save rockwotj/c6b7a8308729ce07d8cbfec10f21bd90 to your computer and use it in GitHub Desktop.
Reverse scroll test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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