I\'m dynamically updating a few elements after a setTimeout()
function. The jQuery function .text()
seems to dynamically update with each change of ind
Text and Progress Bar change dynamically, but with delay === 0
it's very fast: (http://jsfiddle.net/sergdenisov/mh4o1wxz/1/):
HTML:
Text
Javascript:
var delay = 0;
var percent = 0;
var iID = setInterval(function() {
percent += 10;
$('.text').text('Text ' + percent + '/100');
$('.progress-bar').css('width', percent + '%').attr('aria-valuenow', percent);
if (percent === 100) {
clearInterval(iID);
}
}, delay);