Javascript progress animation

后端 未结 1 1685
北海茫月
北海茫月 2021-01-16 11:40

I am trying to build a progress bar using jQuery and javascript.

It is basically a bar

相关标签:
1条回答
  • 2021-01-16 12:29

    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 讨论(0)
提交回复
热议问题