Click here to Skip to main content
15,899,632 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
For the first time that I will call the function LoadProgressBar(), it will show the loading procedure... But when I click the button again, it doesn't show up. Please help, I am new here...



<button onclick="LoadProgressBar()">BUTTON</button>


$(function(){
function LoadProgressBar() {

var progressbar = $("#progressbar"),
progressLabel = $(".progress-label");

progressbar.progressbar({
value: false,
change: function () {
progressLabel.text(progressbar.progressbar("value") + "%");
},
complete: function () {
progressLabel.text("Complete!");
}
});

function progress() {

var progress_value = progressbar.progressbar("value");
progress_value = Math.floor((Math.random() * 20) + 1);

var val = progressbar.progressbar("value") || 0;
progressbar.progressbar("value", val + progress_value);

if (val < 99) {
setTimeout(progress, 500);
}
}
setTimeout(progress, 2000);
}
});
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900