JSFiddle - React, Tailwind, and code Playground
by Nat_Lilit
HTML
<div id="gerljanda" class="gerljanda_3"><div id="nums_1">1</div></div>
CSS
#gerljanda {
position:fixed;
top:0;
left:0;
background-image:url('http://lh5.googleusercontent.com/-obNunPiVVd4/VJOuk2f29_I/AAAAAAAAE3Y/SOoFIrFTTkk/s800/gerljanda1.png');
height:36px;
width:100%;
overflow:hidden;
z-index:99
}
#nums_1
.gerljanda_1 {background-position: 0 0}
.gerljanda_2 {background-position: 0 -36px}
.gerljanda_3 {background-position: 0 -72px}
JavaScript
function gerljanda() {
nums = document.getElementById('nums_1').innerHTML
if(nums == 1) {document.getElementById('gerljanda').className='gerljanda_1';document.getElementById('nums_1').innerHTML='2'}
if(nums == 2) {document.getElementById('gerljanda').className='gerljanda_2';document.getElementById('nums_1').innerHTML='3'}
if(nums == 3) {document.getElementById('gerljanda').className='gerljanda_3';document.getElementById('nums_1').innerHTML='1'}
}
setInterval(function(){gerljanda()}, 600)