How to insert break line in message tooltip

Dang Thi Thuy Tien
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 24, 2018

I want to make the message in the new line

The code in file .vm

<a id="info-config" title="$infor" class="margin-left-5 tooltip-inner aui-icon icon-help"></a>

The code in file .js

AJS.toInit(function () {
AJS.$("#info-config").tooltip();
});

The code in file .java 

StringBuilder configInfo = new StringBuilder(
"Hello world \n ").append("My name ABC \n");

I try some character like \n , \r , \\ , &#013; , &#010; , but it not work .

 

1 answer

1 accepted

1 vote
Answer accepted
Dang Thi Thuy Tien
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 26, 2018

I also resolved this problem. 

Can use "\n" but also modified .tipsy css class

.tipsy{
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 0.85em;
line-height: 1.42857143;
text-align: left;
white-space: pre-wrap;
}
.tipsy-inner{
text-align: left;
}

 white-space: pre-wrap 

Ibrahiem Mohammad November 19, 2018

Can you show how you used "\n" ?

Dang Thi Thuy Tien
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 19, 2018

@Ibrahiem Mohammad I have described above. You should modify .tipsy CSS class in your CSS file. Then you can use "\n" for tool-tip breakline 

Like Ibrahiem Mohammad likes this
Ibrahiem Mohammad November 27, 2018

I was using it how you showed above, but the problem was that I was trying to change the tooltip title attribute before invoking the tooltip() method so it was in effect rewriting any attribute changes I was making.

Thanks for your answer though, it helped me understand tipsy a little bit more.

Suggest an answer

Log in or Sign up to answer