tags:

views:

286

answers:

2

I wanted a jquery plugin which can support links on the tooltip. I couldnt found one.

A: 

BeautyTips supports HTML content (including links) within tooltips:

http://www.lullabot.com/files/bt/bt-latest/DEMO/index.html

Edit

BeautyTips works with HoverIntent to give time to the user to click on the tooltip link. See this example:

<html>
<head>
<script language="javascript" src="http://f.work/layout/jqueryui/js/jquery-1.3.2.min.js"&gt;&lt;/script&gt; 
<script language="javascript" src="http://f.work/layout/js/beautytips/other_libs/jquery.hoverIntent.minified.js" charset="utf-8"></script> 
<script language="javascript" src="http://f.work/layout/js/beautytips/other_libs/bgiframe_2.1.1/jquery.bgiframe.min.js" charset="utf-8"></script> 
<!--[if IE]><script src="http://f.work/layout/js/beautytips/other_libs/excanvas_r3/excanvas.js" type="text/javascript" charset="utf-8"></script><![endif]--> 
<script language="javascript" src="http://f.work/layout/js/beautytips/jquery.bt.js" charset="utf-8"></script> 
<script src="http://f.work/layout/js/beautytips/other_libs/jquery.easing.1.3.js" type="text/javascript" charset="utf-8"></script> 
</head> 
<body>
<img src="/layout/images/logo.png" id="example3" />

<script>

$('#example3').bt(
'<a href="javascript:alert(\'Update the image\')">Change Image</a>',
{
  cssStyles: {color: 'white', fontWeight: 'bold'},
  shrinkToFit: true,
  padding: 20,
  cornerRadius: 10,
  spikeLength: 15,
  spikeGirth: 5,
  positions: ['left', 'right', 'bottom'],
  hoverIntentOpts: {
    timeout: 5000
  }
});

</script>
</body>
</html>
pygorex1
It works but I have to do some tweaking to make it work properly.
San
+2  A: 

This one allows you to have almost anything (html/text) in the tooltip:
http://jquery.bassistance.de/tooltip/demo/

My question for you. Tooltips usually are supposed to be able to appear upon hovering a text/element and disappear when not hovering. So if you have a conventional tooltip behavior, the tooltip link is going to disappear before your mouse moves to click it.

You might have to implement something to handle that. A delayed disappearing or a tooltip positioned overlapping or just adjacent to the element. :P

o.k.w
Actually I wanted a link on an image saying "change image", the link should appear only when the user hovers over the image. Do you know a plugin which does that?
San
Well spotted about the how to click the link