开发者

jquery tooltip with links on it

开发者 https://www.devze.com 2022-12-13 04:47 出处:网络
I wanted a jquery plugin which can support links on the tooltip. I couldnt found o开发者_运维问答ne.This one allows you to have almost anything (html/text) in the tooltip:

I wanted a jquery plugin which can support links on the tooltip. I couldnt found o开发者_运维问答ne.


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


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"></script> 
<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>
0

精彩评论

暂无评论...
验证码 换一张
取 消