Question

Below is the css I am using for my jquery plugin.

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

<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>

I have tried using /br , /r/n , and pressing enter in the title but none of them seems to work. Can someone please help me .

Was it helpful?

Solution

That plug-in allows HTML in the tooltip. The HTML for a line break is <br>.

OTHER TIPS

You can use jquery tipsy, which supports a <br />.

Or if you still want to use jquery tooltip, you can do it this way - Multiple HTML lines with jquery tooltip plugin which is a duplicate question/answer similar to what you want if you want full html support.

jquery tooltip should support <br /> too.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top