/*
@method: countTo 从0涨到某个0-9的正整数的动态效果,如果是大于9的正整数,循环调用即可,注意:是每一位独立从0涨到该位所在的数字
@param: {Number} toNumber
@param: {String} id
@return: {undefined}
*/
countTo (toNumber, id) {
let start = -1
let dom = document.getElementById(id)
if (!dom || !Number(toNumber)) {
return
}
let timer = setInterval(() => {
start++
dom.innerText = start
if (start === Number(toNumber)) {
clearInterval(timer)
}
}, 50)
}