document.getElementById('but').onclick=function(){
function func() {
$(document).ready(function() {
if(!Modernizr.meter){
alert('Ошибка!');
} else {
var progressbar = $('#progressbar'),
max = progressbar.attr('max'),
time = (2000/max)*1,
value = progressbar.val();
var loading = function() {
value += 1;
addValue = progressbar.val(value);
$('.progress-value').html(value + ' %');
if (value == max) {
clearInterval(animate);
}
};
var animate = setInterval(function() {
loading();
}, time);
};
});
}
setTimeout(func, 5000);
}