不知道是否可能,我试图在输入组内的glyphicon上调用工具提示,我的代码(不起作用)是;

<div class="input-group">
<input type="text" class="form-control" name="security" id="security"><span class="input-group-addon"><span class="glyphicon glyphicon-info-sign" data-toggle="tooltip" data-container: 'body' title="" data-original-title="Security Code"></span></span>
</div>

我正在使用Bootstrap 3和最新版本的jQuery。

最佳答案

您可以使用title属性(在您的示例中为空白)在glyphicon上获得一个简单的工具提示。

title="info"

工作代码
 // add this in your js
 // all the glyphicons having the class "my-tooltip" will show a tooltip if "title" attribute is present
 $(".my-tooltip").tooltip();

 <span class='glyphicon glyphicon-info-sign my-tooltip' title="here goes the tooltip text"></span>

关于twitter-bootstrap - Glyphicon上的Bootstrap 3工具提示,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/19688974/

10-13 00:43