1

下面是我用于我的 jquery 插件的 css。

CSS

<style type="text/css">
    body, div { font-family: arial, sans-serif;}
    body { margin: 0; padding: 0; }
    h3 {
        font-size: 110%;
        font-weight: normal;
        margin: .2em 0 .5em 0;
    }
    #tooltip {
        position: absolute;
        z-index: 3000;
        border: 1px solid #111;
        padding: 5px;
    }
    #tooltip h3, #tooltip div { margin: 0; }
</style>

脚本

<script type="text/javascript">
    $(function () {
        $('.studentclass').tooltip({ showURL: false, positionLeft: true, html:true});
        $("#block").click($.tooltip.block);
    });
</script>

HTML

<label id="lblstudentname" 
    runat="server" 
    title="Name of the student in the class "
    class="studentclass">
        STUDENT
    </label>

我曾尝试使用 /br 、 /r/n 并在标题中按回车键,但它们似乎都不起作用。有人可以帮帮我吗 。

4

2 回答 2

1

该插件允许在工具提示中使用 HTML。换行符的 HTML 是<br>.

于 2012-11-13T14:54:33.540 回答
1

您可以使用 jquery Tipsy,它支持<br />.

或者,如果您仍想使用 jquery 工具提示,您可以这样做 -带有 jquery 工具提示插件的多条 HTML 行,如果您想要完整的 html 支持,这是一个重复的问题/答案,类似于您想要的。

jquery 工具提示也应该支持<br />

于 2012-11-13T14:56:52.963 回答