I am using bootstrap to create my website and I am trying to use a progress bar. What I am trying to do is after I complete a function in PHP (I have 10 functions to do) I advance the progress of the bar by 10%. I believe his is done using java-script but I am unsure on how to do it with bootstrap and my current web searches have not turned up anything I could use. (there are examples of when the page loads progress to 100% but I don't know how these work)
<div class="progress progress-striped active">
<div class="bar" style="width: 0%;"></div>
</div>
This above is my HTML definition of the bootstrap progress bar. I know changing the width changes the percentage of what is filled in but I don't know how to change it after I have completed a function (functions are all in one page ran one after another).
Could someone help? or point me in the right direction?
If you need to make an animation of progress barr in one step, you can make two lines of code:
see the demo https://jsfiddle.net/qLgv2Lfm/29/
Prefer using JQuery
or in Javascript
You can change the width of your progress bar like this :
Just keep repeating this whenever the values of
percentageCompleted
changes, until that value is 100.A demo
(see also this Fiddle)