Bootstrap tooltip stops working after any other event runs

梦想的初衷 提交于 2020-01-04 14:31:22

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/25302104/bootstrap-tooltip-stops-working-after-any-other-event-runs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!