是否有支持HTML内容并自动定位工具提示的JQuery工具提示插件? [英] Is there a JQuery tooltip plugin that supports HTML content and automatically positions tooltips?
问题描述
我正在为JQuery搜索Tooltip插件/库。它应该能够自动定位工具提示,例如提示提示,并且还支持HTML提示内容。
I am searching for a Tooltip plugin/library for JQuery. It should be able to automaticlly position tooltips, like TipTip, and also support HTML content for the tips.
TipTip确实满足两个条件,但是:
TipTip does fullfill both conditions, but:
使用提示添加HTML支持小费。您现在可以将HTML添加到Title属性中(但如果您需要严格有效的代码,则不建议这样做。)
Added HTML support with Tip Tip. You can now add HTML into the Title attribute (though this is not recommended if you want strictly valid code).
推荐答案
我不想留下jquery本地插件并搞乱其他库,所以我想出了一个非常简单的解决方案:
I didn't want to leave jquery native plugin and mess with additional libs, so I figured out quite simple solution:
$('.tooltips').tooltip({
content: function(){
return $(this).attr('title');
}
})
这样 - 您的HTML标题属性可以成功使用。
This way - your title attribute with HTML may be used successfully.
这篇关于是否有支持HTML内容并自动定位工具提示的JQuery工具提示插件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!