Using javascript with jquery and bootstrap, I would like to have nice progress bar during heavy javascript computation. I know exactly the progress state of computation, but CSS is not updating during the computation.
WebWorker is not a solution as I need to work with a model in main thread which I am not able to copy/clone easily to the worker.
Example: Progressbar is updated at the end. I want it to update during the process.
html code:
<div class="progress">
<div id="loading" class="bar progress-bar progress-bar-info" style="width: 0%"></div>
</div>
javascript code:
for (var i = 0; i <= 10; i++) {
$('#loading').css('width', i * 10 + '%');
heavycomputation();
};