[html] Progress Bar with HTML and CSS

Progress Bar without nested divs... for every element where the css linear-gradient works.

Here the JSFiddle http://jsfiddle.net/oj1L3y6t/2/

_x000D_
_x000D_
function show_progress(i) {_x000D_
  var progress1 = i;_x000D_
  var progress2 = progress1 + 1;_x000D_
  var progress3 = progress1 + 2;_x000D_
_x000D_
  var magic = "linear-gradient(to right, #FFC2CE " + progress1 + "% ,red " + progress2 + "% , #FFFFFF " + progress3 + "%)";_x000D_
  document.getElementById("progress-0").style.background = magic;_x000D_
_x000D_
  var magic = "linear-gradient(to right, lightblue " + progress1 + "% , lightgreen " + progress2 + "%)";_x000D_
  document.getElementById("progress-1").style.background = magic;_x000D_
_x000D_
  var magic = "linear-gradient(to right, lightblue " + progress1 + "% , #FFFFFF 100%)";_x000D_
  document.getElementById("progress-2").style.background = magic;_x000D_
_x000D_
  var magic = "linear-gradient(#FFC2CE " + progress1 + "% ,red " + progress2 + "% , #FFFFFF " + progress3 + "%)";_x000D_
  document.getElementById("progress-3").style.background = magic;_x000D_
}_x000D_
_x000D_
function timeout() {_x000D_
  t = setTimeout(function() {_x000D_
    show_progress(t)_x000D_
    timeout();_x000D_
  }, 50);_x000D_
  if (t == 78) {_x000D_
    clearTimeout(t);_x000D_
  }_x000D_
  console.log(t);_x000D_
}_x000D_
_x000D_
timeout();
_x000D_
#progress-0 {_x000D_
  border: 1px solid black;_x000D_
  width: 500px;_x000D_
  background: #999;_x000D_
  text-align: center;_x000D_
}_x000D_
_x000D_
#progress-1 {_x000D_
  border: 1px solid black;_x000D_
  width: 500px;_x000D_
  background: #999;_x000D_
  text-align: center;_x000D_
  margin-top: 10px;_x000D_
  border-radius: 10px;_x000D_
}_x000D_
_x000D_
#progress-2 {_x000D_
  border: 1px solid black;_x000D_
  width: 500px;_x000D_
  background: #999;_x000D_
  text-align: center;_x000D_
  margin-top: 10px;_x000D_
}_x000D_
_x000D_
#progress-3 {_x000D_
  border: 1px solid black;_x000D_
  width: 100px;_x000D_
  height: 100px;_x000D_
  background: #999;_x000D_
  line-height: 100px;_x000D_
  text-align: center;_x000D_
  margin-top: 10px;_x000D_
  border-radius: 200px;_x000D_
}
_x000D_
<div id="progress-0">Loading</div>_x000D_
<input id="progress-1" value="Loading"></input>_x000D_
<button id="progress-2">Loading</button>_x000D_
<p id="progress-3">Loading</p>
_x000D_
_x000D_
_x000D_

Examples related to html

Embed ruby within URL : Middleman Blog Please help me convert this script to a simple image slider Generating a list of pages (not posts) without the index file Why there is this "clear" class before footer? Is it possible to change the content HTML5 alert messages? Getting all files in directory with ajax DevTools failed to load SourceMap: Could not load content for chrome-extension How to set width of mat-table column in angular? How to open a link in new tab using angular? ERROR Error: Uncaught (in promise), Cannot match any routes. URL Segment

Examples related to css

need to add a class to an element Using Lato fonts in my css (@font-face) Please help me convert this script to a simple image slider Why there is this "clear" class before footer? How to set width of mat-table column in angular? Center content vertically on Vuetify bootstrap 4 file input doesn't show the file name Bootstrap 4: responsive sidebar menu to top navbar Stylesheet not loaded because of MIME-type Force flex item to span full row width

Examples related to progress-bar

How to Create a circular progressbar in Android which rotates on it? Dynamically change bootstrap progress bar value when checkboxes checked Tkinter: How to use threads to preventing main event loop from "freezing" File upload progress bar with jQuery CSS Progress Circle How to set the Android progressbar's height? How to use WinForms progress bar? Display a loading bar before the entire page is loaded Progress Bar with HTML and CSS How to change color in circular progress bar?