J.Zil
J.Zil

Reputation: 2449

Adding tooltip to progress bar bootstrap

This is my code: http://jsfiddle.net/52VtD/7255/

<div class="progress">
  <div class="progress-bar progress-bar-success" style="width: 10%" data-toggle="tooltip" data-placement="bottom">
    <span class="sr-only">35% Complete (success)</span>
  </div>
  <div class="progress-bar progress-bar-warning progress-bar-striped" style="width: 50%" data-toggle="tooltip" data-placement="bottom">
    <span class="sr-only">10% Complete (warning)</span>
  </div>
  <div class="progress-bar progress-bar-danger" style="width: 10%" data-toggle="tooltip" data-placement="bottom">
    <span class="sr-only">10% Complete (danger)</span>
  </div>
</div>

JavaScript:

$(document).ready(function() {

    $('.progress').tooltip();

});

It doesn't seem to work though, the tooltips don't show up. Can anyone please explain where I am going wrong?

Upvotes: 3

Views: 4866

Answers (1)

Richa
Richa

Reputation: 3289

You can try something like this

$('.progress-bar[data-toggle="tooltip"]').tooltip({
    animated: 'fade',
    placement: 'bottom'
});

Have a look at FIDDLE

Upvotes: 2

Related Questions