I am trying to build a progress bar using jQuery and javascript.
It is basically a bar
-
1st get the jQuery progressbar plugin.
Here's an example.
Then create a function like:
num = 0;
function pbUpdate(value){
if (num <= value) {
window.setInterval('updAnimation(' + value + ')', 10);
}else{
clearTimeout;
}
}
function updAnimation(value){
num += 1;
if (num <= value){
$("#pb").reportprogress(num);
}
}
If you look at the examples of the plugin and look at this code, you should get to where you want to go. I've used this code as well.
讨论(0)