在Bootstrap工具提示中显示长文本 [英] Displaying long text in Bootstrap tooltip
本文介绍了在Bootstrap工具提示中显示长文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图在twitter bootstrap工具提示中显示一些长文本。正如你在下面的图片中可以看到的,事情不会垮台。有没有人能够容易修复溢出引导工具提示的文本?
I'm trying to display a bit of long text in a twitter bootstrap tooltip. As you can see in the picture below, things aren't going smashingly. Does anyone have an easy fix for text that overflows the bootstrap tooltip?
EDIT(添加的请求代码):
EDIT (added requested code):
p>
In my controller:
<a href='" + Url.Action("Index", "PP", new {id = productRow.ProductGuid, area = ""}) + "' " +
((blTruncated) ? "class='auto-tooltip' title='" + productRow.ProductName.Replace("'", "") : "") + "'>" +
productName + "</a>
在我看来:
$('.auto-tooltip').tooltip();
推荐答案
我不确定您的代码,
这里是一个具有较长工具提示值的示例:
I'm not sure about your code,
here is an example with a long tool-tip value:
元素:
<a href="#" rel="tooltip" title="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas bibendum ac felis id commodo. Etiam mauris purus, fringilla id tempus in, mollis vel orci. Duis ultricies at erat eget iaculis.">Hover here please</a>
Js:
$(document).ready(function () {
$("a").tooltip({
'selector': '',
'placement': 'top',
'container':'body'
});
});
Css:
/*Change the size here*/
div.tooltip-inner {
max-width: 350px;
}
演示:在JsBin.com
这篇关于在Bootstrap工具提示中显示长文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文