<button title="Tooltip on right" data-placement="right" data-toggle="tooltip" class="btn btn-default mrs" type="button">Tooltip on right</button>
<script>
$(function () {
$('[data-toggle=tooltip]').tooltip();
});
</script>
这很好用,但我想在工具提示中包含一张图片和一些文字.我尝试使用 data-content="some stuff" 但它什么也没显示.
This works fine but I'd like to include an image and some text inside the tooltip. I tried to use data-content="some stuff" but it shows nothing.
你必须在初始化.tooltip时传入html选项.例如
You have to pass in the html option to when you initialize .tooltip. e.g.
<div class="cart">
<a data-toggle="tooltip" title="<img src='http://getbootstrap.com/apple-touch-icon.png' />">
<i class="icon-shopping-cart"></i>
</a>
$('a[data-toggle="tooltip"]').tooltip({
animated: 'fade',
placement: 'bottom',
html: true
});
查看示例fiddle
这篇关于使用引导程序的工具提示中的图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!