一个现代时尚的数字时钟js插件,带动画进度条倒计时到下一分钟。const hour = document.getElementById('hour'); const minute = document.getElementById('minute'); const second = document.getElementById('second'); const progress = document.getElementById('progress'); function showCurrentTime() { let date = new Date(); let hr = date.getHours(); let min = date.getMinutes(); let sec = date.getSeconds(); hour.textContent = hr; minute.textContent = min; second.textContent = sec; progress.style.width = (sec / 60) * 100 + '%' } setInterval(showCurrentTime, 1000)
preview Points Download 6毛Download Share Download
未经允许不得转载: ICode联盟 » Plugin Special Effects » 时尚的数字时钟js插件带进度条