dreyescat / bootstrap-rating

Bootstrap Rating is a jQuery plugin that creates a rating control that uses Bootstrap glyphicons for rating symbols.
http://dreyescat.github.io/bootstrap-rating/
MIT License
192 stars 78 forks source link

Tool tip not showing #26

Open cmanish049 opened 8 years ago

cmanish049 commented 8 years ago

I am trying to integrate it in my site, plugin is working fine but tooltip is not showing. Can u please help?

dreyescat commented 8 years ago

Not sure what your problem is. I can point out some documentation and a little example using the bootstrap tooltip.

<input type="hidden" class="rating-tooltip"/>
$('input.rating-tooltip').rating({
  extendSymbol: function (rate) {
    $(this).tooltip({
      container: 'body',
      placement: 'bottom',
      title: 'Rate ' + rate
    });
  }
});

Check this bootstrap rating tooltip fiddle.

kuntur-studio commented 8 years ago

If you use the class "rating" for the hidden input it will automatically apply the plugin but because of this if you try to initialize it with the option extendSymbol the callback won't be called (because it was already initialized). So, if you need to use extendSymbol don't give the class "rating" to the input element.

dreyescat commented 8 years ago

As @kuntur-studio states rating auto-initialization could be the cause. Just avoid using rating as class name and it should work. In my example above I used rating-tooltip.

Take a look at issue #17 for more info.