0

How do I a line-break to the code below so each line will tell its own fact? can this be done?

 <area target="" research="Spellcraft Delve into the arcane mysteries of Spellcraft, discovering new ways to produce and use mana. Increases: Fairy,Faceless and Drow production." href="" coords="47,39,109,99" shape="rect">
Ricky
  • 3
  • 2
  • Here is where i am using the code http://musicfamily.org/realm/Researchtree/ – Ricky May 09 '16 at 01:52
  • You seam to use some kind of javascript library for that, because `research` is an unknown attribute for me (http://www.w3schools.com/tags/tag_area.asp). But maybe this solution for `title` may apply also: http://stackoverflow.com/questions/358874/how-can-i-use-a-carriage-return-in-a-html-tooltip (adding `\n`, `\u000A`, `\x0A` or ` ` may work as linebreaks)? – Seika85 May 09 '16 at 06:22
  • It is a title attribute as I just replaced the word title with research because I only wanted the image to be affected. Within the – Ricky May 09 '16 at 10:15
  • Sorry i was mistaken,codes \n, and will not show in tooltip and not give a linebreak but the codes \u000A, \x0A will show in the tooltip and not give a linebreak. the script i am using is Style-my-tooltips jQuery plugin and can be seen here http://manos.malihu.gr/style-my-tooltips-jquery-plugin/ – Ricky May 09 '16 at 10:27

1 Answers1

0

It is not going to work with the plugin you are using. That's because it uses the jQuery.text() function to move the content of the title attribute to the newly created div. And therefore no HTML content (including &x13;) is rendered as it should, but as plain text.
You can either edit the sourcecode and change it at line 68 in jquery.style-my-tooltips.js from .text() to .html(). (But that would may open up some vulnerabilities.)
Or you use a different library supporting HTML tooltips.

Or you just get rid of using JS and try using CSS only, like here: Tooltip with HTML content without JavaScript

Community
  • 1
  • 1
Seika85
  • 1,981
  • 2
  • 18
  • 29
  • Thank you Seika85 as I have been pulling my hair out trying to get this to work and your 2 options helped tremendously and as the pages i will be using the jquery on are for a game and have no worries about vulnerabilities I selected to change line 68 and it worked perfectly again Thank You :) – Ricky May 19 '16 at 18:19
  • You are free to accept my answer if it was helpful. ;) – Seika85 May 20 '16 at 08:59