Tri*_*ung 3 html jquery stylesheet
我在html页面上创建了一个jQuery Tooltip.我想在超链接上显示带有html内容的工具提示.但jQuery的工具提示只显示所有的HTML文本为工具提示中普通的文本,但不具有HTML格式.有一个jQuery Tooltip的例子.
<head>
<title>jQuery Tooltip</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
<script>
$(function() {
$(document).tooltip();
});
</script>
<style>
label {
display: inline-block;
width: 5em;
}
</style>
</head>
<body>
<a href="#" title="<font color='#FF0000'>That's what this widgets</font>">Tooltips</a>
</body>
Run Code Online (Sandbox Code Playgroud)
工具提示,而不是显示红色的文本"这就是这个小部件" ,它显示" <font color='#FF0000'>That's what this widgets</font>".html格式不适用于工具提示文本.似乎工具提示无法识别html格式.问题似乎是工具提示上的样式不正确或者可能是jQuery工具提示不支持html内容.
我想知道为什么我的jQuery工具提示无法显示html内容?我需要一些关于我的问题的帮助.
Aru*_*hny 11
$(function(){
$('[title]').tooltip({
content: function(){
var element = $( this );
return element.attr('title')
}
});
});
Run Code Online (Sandbox Code Playgroud)
演示:Plunker