Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JQuery tooltip that supports new line

I'm looking for a lightweight jquery plugin for displaying tooltips when the user hovers over an element. I would like the plugin to get the content from the title attribute and also it's important that I can make new lines.

Any help is appreciated!

like image 988
Nordis Avatar asked Dec 20 '10 16:12

Nordis


1 Answers

I usually use tipsy.


You can add any html element in tipsy, so <br/> works.

You just need to pass the html option as such :

$('#example-html').tipsy({html: true });

If you don't want to use the title attribute to display html (it won't validate in this case), you can use the fallback option.

$('#example-fallback').tipsy({fallback: "Where's my tooltip yo'? <br/> yay !" });

More options and examples on the tipsy webpage.

like image 60
Shikiryu Avatar answered Oct 07 '22 22:10

Shikiryu