Search code examples
jqueryjquery-uitooltipjquery-tooltipjquery-ui-tooltip

How do I add an image inside a jQuery UI tooltip?


I want to have a tooltip display an image. I tried the methods described here, but nothing worked. I've also tried other jQuery UI widgets, and they do work. Here is my code:

HTML:

<a id='gamercard' href='https://live.xbox.com/en-US/Profile?Gamertag=Daddy+Kiefer' title=''>Daddy Kiefer</a>.</p>

js:

$(function () {

   $("#gamercard").tooltip({
       content: '<img src="http://gamercard.zaamit.com/nxe/Daddy%20Kiefer.png" />'
   });
});

Any advice on where I'm going wrong would be appreciated.


Solution

  • Works for me with exact same code above:

    http://jsfiddle.net/fiddleyetu/wu23h/show/

    $(function () {
    
       $("#gamercard").tooltip({
           content: '<img src="http://gamercard.zaamit.com/nxe/Daddy%20Kiefer.png" />'
       });
    });