Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@brydavis
Created January 21, 2020 17:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brydavis/d54dbf73f76832d0ac6810551adaf64b to your computer and use it in GitHub Desktop.
Save brydavis/d54dbf73f76832d0ac6810551adaf64b to your computer and use it in GitHub Desktop.
function move(pb) {
pb.style.width = "0%"
setTimeout(function () {
console.log("start")
var width = 1;
var id = setInterval(frame, 50);
function frame() {
if (width >= 100) {
clearInterval(id);
console.log("done")
} else {
width++;
pb.style.width = width + '%';
}
}
}, 1000)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment