在运行任何其他事件后,Bootstrap工具提示停止工作 [英] Bootstrap tooltip stops working after any other event runs

查看:142
本文介绍了在运行任何其他事件后,Bootstrap工具提示停止工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Bootstrap v3.2.0中使用工具提示.它们在页面首次加载时都可以正常工作,但是如果我在页面上执行任何涉及运行som js代码的操作,它们都将停止工作.至少那是我对该问题的第一印象.

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.

我这样启动工具提示:

$('[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>

正如我所说,该工具提示最初是有效的,但是当我在页面上执行任何涉及运行js的操作时,该工具提示将停止工作.

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

有什么想法吗?

推荐答案

仅在发布此问题后,我才意识到问题所在.我的工具提示位于购物车内,每当我向其中添加产品时都会重新构建.每次重建购物车时,我都需要重新启动工具提示.

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.

这篇关于在运行任何其他事件后,Bootstrap工具提示停止工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆