Created
November 10, 2019 05:35
-
-
Save sudikrt/85a0f7df4b2bd686fe03b41b79a54964 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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