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