Skip to content

Instantly share code, notes, and snippets.

@pemrouz
Created May 28, 2016 13:27
Show Gist options
  • Save pemrouz/9353cbd14bd3b73520db915e7213dd8f to your computer and use it in GitHub Desktop.
Save pemrouz/9353cbd14bd3b73520db915e7213dd8f to your computer and use it in GitHub Desktop.
<style>
#a, #b {
position: absolute;
top: 0;
left: 0;
width: 20%;
height: 100px;
text-align: center;
line-height: 100px;
background: red;
overflow: hidden;
}
#b {
right: 0;
left: initial;
background: green;
}
</style>
<div id="a">A</div>
<div id="b">1</div>
<script>
setInterval(function(){
var val = ++b.textContent
b.textContent = val % 10
}, 1000)
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment