Here is my HTML:
<progress class="progressbar" value="0" max="100" data-max="1"></progress>
I link to jquery and modernizr.
Here is my javascript:
$(document).ready(function() {
$('.progressbar').each(function() {
var progressbar = $(this),
progressbarValue = progressbar.next(),
value = progressbar.data('min') || 0,
max = progressbar.data('max'),
time = (100 / max) * 5,
value = progressbar.val(),
animate = setInterval(loading, time);
function loading() {
value += 1;
progressbar.val(value);
progressbarValue.html(value + '%');
if (value == max) {
clearInterval(animate);
}
};
})
});

New Topic/Question
Reply


MultiQuote


|