jquery - Percentage Progressing Bars -


i found animation progressing bars here

i wonder how add number % running each bar while these progressing bars loading.

please help. thank you!

here css

    <style type='text/css'>     .progress_container {     height:25px;     border-radius: 3px;     overflow:hidden;     background:red;     width: 460px; } .progress_bar {     height:25px;     width: 0px;     -moz-border-radius:3px;     -webkit-border-radius:3px;     border-radius:3px;     background:black; } .progress_container {     margin-bottom: 30px; } }   </style> 

here jquery

  <script type='text/javascript'>//<![cdata[  $(window).load(function(){ $("document").ready(function () {      // animate progress bar onload      $('.progress_bar').each(function () {         $(this).animate({             width: this.title         }, 1000);     })  }); });//]]>    </script> 

here body

  <div class="progress_container">     <div class="progress_bar tip" title="98%"></div> </div> <div class="progress_container">     <div class="progress_bar tip" title="58%"></div> </div> <div class="progress_container">     <div class="progress_bar tip" title="28%"></div> </div> 

you'd use step method :

$('.progress_bar').each(function () {     $(this).animate(       {          width: this.title       }, {         duration: 1000,         step    : function( current ) {                     $(this).html(parseint(current, 10)+'%')         }     }); }); 

fiddle


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

c++ - Clear the memory after returning a vector in a function -

erlang - Saving a digraph to mnesia is hindered because of its side-effects -