计时器进度循环:
大家好,我怎样才能使减少圆线的动画与计时器同步?只是现在动画结束的速度比计时器快。
let progressCircle = document.getElementById("progress-line");
let angle = 565;
let angleIncrement = 1;
const min = 0;
const lineAnimation = setInterval(() => {
progressCircle.setAttribute("stroke-dasharray", angle + ", 20000");
angle -= angleIncrement;
if (angle <= min) {
angle = 0;
clearInterval(lineAnimation);
}
}, 1000);
暂无答案!
目前还没有任何答案,快来回答吧!