繁体   English   中英

标题属性中带有html内容的jQueryUI工具提示

[英]jQueryUI tooltip with html content in title attribute

嗨,我有这个问题Jquery UI工具提示不支持html内容 ,我已经尝试了所有解决方案,但没有人解决。 实际上,我尝试使用此代码,但也没有用

<script>
    $(document).ready(function () {
        $('li.thumbnail a').tooltip({
            content: function () {
                return 'hola';
            }
        });
    })
</script>

我能做什么?

将html放在工具提示中没问题。 只需注意html的特殊字符(用html实体或替换的双引号和单引号引起来),然后,如果要使其动态化,请使用.attr()而不是jQuery UI方法。

采用:

$('selector').attr('title', 'content here' );

代替:

$('selector').tooltip({content: 'content here'});

您将在此小提琴中找到有效的示例

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM