Search code examples
javascriptjquerytwitter-bootstraptwitter-bootstrap-3tooltip

Bootstrap tooltip stops working after any other event runs


I'm using tooltips in Bootstrap v3.2.0. They all work as they should when the page first loads, but if I do anything on the page that involves running som js code, they stop working. At least that's my first impression of the problem.

I initiate my tooltips like so:

$('[data-toggle=tooltip]').tooltip();

And this is the code I use for a tooltip:

<span class='my-tooltip' data-toggle='tooltip' data-placement='left' title='Lorem ipsum dolor sit amet'><i class='fa fa-info'></i></span>

As I said, the tooltip initially works, but when I do anything on the page that involves running some js, the tooltip stops working.

Any ideas?


Solution

  • Just after posting this question, i realised the problem. My tooltip exists inside a cart, that is rebuilt each time I add a product to it. I needed to re initiate my tooltip each time I rebuild my cart.