我正在尝试在工具提示标题上显示html内容。
但是显示纯文本。
<a href="javascript:void(0);" data-html="true" data-toggle="tooltip1" title="<p><label>package_qty</label> (0 status)</p>">0</a>
初始化:
$('[data-toggle="tooltip1"]').tooltip();
将data-html
的值设置为true
似乎无效。
我正在使用引导程序版本3.3.7
。
答案 0 :(得分:0)
希望这些链接能为您带来愉快的一天!
讨论Can I use complex HTML with Twitter Bootstrap's Tooltip?
提琴http://jsfiddle.net/44khF/200/
$('.tooltip-demo.well').tooltip({
selector: "a[rel=tooltip]"
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet"/>
<div class="tooltip-demo well">
<p style="margin-bottom: 0;" class="muted">Tight pants next level keffiyeh you probably haven't heard of them. Photo booth beard raw denim letterpress vegan messenger bag stumptown. Farm-to-table seitan, mcsweeney's fixie sustainable quinoa 8-bit american apparel have a terry richardson vinyl chambray. Beard stumptown, cardigans banh mi lomo thundercats. Tofu biodiesel williamsburg marfa, four loko mcsweeney's cleanse vegan chambray. A <a title="<h1><b>Another</b> <em>one</em> here too</h1>" data-html="true" rel="tooltip" href="#">really ironic</a> artisan whatever keytar, scenester farm-to-table banksy Austin twitter handle freegan cred raw denim single-origin coffee viral.
</p></div>