Search  


JavaScript Progress Bar (CSS Code Share Example) 
Thursday, April 23, 2020, 09:39 AM
Posted by Administrator
#edutech #college #work #NFT #education #remotework #onlinelearning #stem #talent #diversity #highered #STEM #blog

<!DOCTYPE html>
<html>
<style>
#myProgress {
width: 100%;
background-color: #ddd;
}

#myBar {
width: 1%;
height: 30px;
background-color: #4CAF50;
}
</style>
<body>

<h1>JavaScript Progress Bar</h1>

<div id="myProgress">
<div id="myBar"></div>
</div>

<br>
<button onclick="move()">Click Me</button>

<script>
var i = 0;
function move() {
if (i == 0) {
i = 1;
var elem = document.getElementById("myBar");
var width = 1;
var id = setInterval(frame, 10);
function frame() {
if (width >= 100) {
clearInterval(id);
i = 0;
} else {
width++;
elem.style.width = width + "%";
}
}
}
}
</script>

</body>
</html>
add comment ( 135 views )   |  permalink   |  $star_image$star_image$star_image$star_image$star_image ( 3 / 440 )

<<First <Back | 1086 | 1087 | 1088 | 1089 | 1090 | 1091 | 1092 | 1093 | 1094 | 1095 | Next> Last>>







Share CertificationPoint & Stay Informed Socially About EduTech?