Skip to content

Instantly share code, notes, and snippets.

@sudikrt
Created November 10, 2019 05:35
Show Gist options
  • Select an option

  • Save sudikrt/85a0f7df4b2bd686fe03b41b79a54964 to your computer and use it in GitHub Desktop.

Select an option

Save sudikrt/85a0f7df4b2bd686fe03b41b79a54964 to your computer and use it in GitHub Desktop.
function progress () {
let progressBar = document.getElementById ('progress');
let percentCount = document.getElementById ('percentcount');
let vc_label_units = document.getElementById ('vc_label_units');
let counter = 5;
let progress = 25;
let id = setInterval (frame, 50);
function frame () {
if (progress == 500 && counter == 100) {
clearInterval (id);
} else {
progress += 5;
counter += 1;
progressBar.style.width = progress + 'px';
percentCount.innerHTML = counter + '%';
vc_label_units.innerHTML = counter + '%';
}
}
}
progress ();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment