Search code examples
twitter-bootstraptooltip

Can I change title of bootstrap tooltip without hiding it?


I would like the tooltip to display time. For this I update it every somemany seconds but changing the title every time.

$(".track a").tooltip('hide');
$(".track a").data('tooltip').options.title = time;
$(".track a").tooltip('show');

This works but the tooltip is flickering but without the hide and show the tooltip doesn't update. Is there a way to update the tooltip without hiding and showing it?

Thanks!


Solution

  • Ok aparantly the problem was somewhere else.

    Anyway now I use this one because this changes all the components that need a tooltip where the one above only changes one component.

    $(".track a").tooltip('hide')
      .attr('data-original-title', time)
          .tooltip('fixTitle')
          .tooltip('show');
    

    You do have to put the animation on false when initializing the tooltip:

    $(".track a").tooltip({
          'animation' : false
    });