Thursday, 4 August 2016

CREATE A PROGRESS BAR USING HTML JAVASCRIPT AND CSS

Have you wanted to create a progress bar to show the load progress of your page here is a sample code for you feel free to ask questions and we will be more than glad to answer

<!DOCTYPE html>
<html>
<style>
#myProgress {
  position: relative;
  width: 100%;
  height: 30px;
  background-color:gray;
}

#myBar {
  position: absolute;
  width: 10%;
  height: 100%;
  background-color:skyblue;
}

#label {
  text-align: center;
  line-height: 30px;
  color: white;
}
</style>
<body>


<div id="myProgress">
  <div id="myBar">
    <div id="label">5%</div>
  </div>
</div>

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

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

</body>
</html>

click here to see what your result should look like
Share:

1 comment:

  1. Create A Progress Bar Using Html Javascript And Css ~ Itgist >>>>> Download Now

    >>>>> Download Full

    Create A Progress Bar Using Html Javascript And Css ~ Itgist >>>>> Download LINK

    >>>>> Download Now

    Create A Progress Bar Using Html Javascript And Css ~ Itgist >>>>> Download Full

    >>>>> Download LINK

    ReplyDelete