Created
January 21, 2020 17:59
-
-
Save brydavis/d54dbf73f76832d0ac6810551adaf64b to your computer and use it in GitHub Desktop.
This file contains 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 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