我需要幫助,我怎樣才能使一個進度條,當在window.onload,它已經從底部填滿到頂部,在此代碼它的工作原理反向如何顯示從底部垂直進度條到頂部
function move() {
var elem = document.getElementById("myBar");
var height = 0;
var id = setInterval(frame, 100);
function frame() {
if (height >= 70) {
clearInterval(id);
} else {
height++;
elem.style.height = height + '%';
elem.innerHTML = height * 1 + '%';
}
}
}
window.onload = move();
#myProgress {
width:100px;
background-color: red;
height:100px
}
#myBar {
width: 100px;
background-color: #4CAF50;
text-align: center;
color: white;
}
<div id="myProgress">
<div id="myBar">0</div>
</div>
我覺得你用標籤混淆了標題。請提供一個描述性標題。 – louisfischer