Glyphicon 上的 Bootstrap 3 工具提示 [英] Bootstrap 3 Tooltip over Glyphicon

查看:36
本文介绍了Glyphicon 上的 Bootstrap 3 工具提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不确定这是否可能,我试图在输入组内的字形上调用工具提示,我的代码(不起作用)是;

<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>

我使用的是 Bootstrap 3 和最新版本的 jQuery.

解决方案

您可以使用 title 属性(在您的示例中为空白)获得有关字形图标的简单工具提示.

title="信息"

工作代码

//在你的 js 中添加这个//如果存在title"属性,则所有具有my-tooltip"类的字形都将显示工具提示$(".my-tooltip").tooltip();<span class='glyphicon glyphicon-info-sign my-tooltip' title="这里是工具提示文本"></span>

Not sure if this even possible, I am trying to invoke a tooltip over a glyphicon inside an input group, my code (which does not work) is;

<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>

I'm using Bootstrap 3, and the latest version of jQuery.

解决方案

You can get a simple tooltip over the glyphicon using the title attribute (which is blank in your example).

title="info"

Working code

 // 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>

这篇关于Glyphicon 上的 Bootstrap 3 工具提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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