I am trying to find the best option to create a simple progress bar that I need to be triggered periodically from within another JavaScript script.
Every few minutes, a timer would cause the progress bar to start going from 0 to 100%. Once it reaches 100%, the bar would reset to 0.
I am trying to implement a smooth animated version of the bar, like this one: http://www.webappers.com/progressBar/. (I tried adapting this particular one but I could not get it to work the way I described)
I am looking into the jQuery UI ProgressBar: Is it possible to use it in the manner I have described?
Thank you.
This is pretty quick to do with the jQuery UI progress bar, just call this initially:
And this in your other script, probably via
setInterval():Put it together like this:
The animated effect keeps it a bit smoother looking as well: see here for a demo. This is done via a single CSS rule, in the demo case: