【发布时间】:2015-09-13 23:34:09
【问题描述】:
我不知道是什么原因,但在 tooltipster 中,html 内容不会显示。我对 html 进行了编码,在脚本中添加了选项,但仍然是一个字符串。
$(document).ready(function() {
$('.tooltip').tooltipster({
contentAsHTML: true,
interactive: true,
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://iamceege.github.io/tooltipster/js/jquery.tooltipster.js"></script>
<link rel="stylesheet" href="http://iamceege.github.io/tooltipster/css/tooltipster.css">
<span title="&lt;img src=&quot;my-image.png&quot; /&gt; &lt;strong&gt; This text is in bold case !&lt;/strong&gt;" class="tooltip">Why is this not working</span>
【问题讨论】:
-
但我需要在 html 标题中而不是在 JS 中。因为我需要在标题中生成它。
-
这里是更新版本jsfiddle.net/s38oja1q/2在html标题中
标签: javascript jquery html tooltipster