(currentNos, nextNos, index)
| 49 | |
| 50 | |
| 51 | function increaseCount(currentNos, nextNos, index) { |
| 52 | |
| 53 | let current = currentNos[index]; |
| 54 | let next = nextNos[index]; |
| 55 | |
| 56 | if(current.innerText == 9) { |
| 57 | increaseCount(currentNos, nextNos, index-1); |
| 58 | } |
| 59 | |
| 60 | next.classList.add("animate"); |
| 61 | |
| 62 | setTimeout(function() { |
| 63 | current.innerText = next.innerText; |
| 64 | next.classList.remove("animate"); |
| 65 | next.innerText = parseInt(next.innerText) + 1; |
| 66 | if(next.innerText > 9) { |
| 67 | next.innerText = 0; |
| 68 | } |
| 69 | }, 500); |
| 70 | |
| 71 | } |