I have a bootstrap progress bar that has text "Initializing". I would like to update that text when the width reaches 25% to "Stage 1 Complete". Then when it reaches 50%, "Stage 2 Complete", etc...
Are there built in methods to accomplish this? If not, any ideas appreciated.
The HTML
<div class="progress skill-bar">
<div class="progress-bar progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100">
<span class="progress-status">Initializing</span>
<span id="progress-value" class="pull-right">0%</span>
</div>
</div>
The script:
$(document).ready(function () {
$('#validator-click').on('click', function () {
$('.progress .progress-bar').css("width",
function () {
// var progress_value = $(this).css("width");
// $('.progress .progress-bar #progress-value').text(progress_value+'%');
return $(this).attr("aria-valuenow") + "%";
});
});
});
PS: I also have a "progress-value" element that I'd like to serve as a counter to display the percent complete.
See this sample programe
Disclaimer modifying Work from anonymous user
you can do something like this--
check the snippet
Hope this helps!