Bootstrap Tutorial - Fly out progress bar








The following code shows how to fly out progress bar.

Example

<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='http://code.jquery.com/jquery-1.9.1.js'></script>
<link rel="stylesheet" type="text/css"
  href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css">
<script type='text/javascript'>//<![CDATA[ 
$(window).load(function(){<!--from  ww w .  j a va  2  s.co m-->
$('#test1 .bar[data-percentage]').each(function() {
    var $this = $(this);
    $this.animate({
        width: $this.data('percentage')
    }, {
        duration: 1000,
        step: function(value) {
            $(this).text(value + '%');
        }
    });
});
});//]]>  
</script>
</head>
<body>
  <div class="progress" id="test1">
    <div class="bar bar-info" data-percentage="20%"></div>
    <div class="bar bar-danger" data-percentage="40%"></div>
    <div class="bar bar-warning" data-percentage="40%"></div>
  </div>
</body>
</html>

Click to view the demo