我不知道你一直在寻找什么,但快速谷歌搜索 jquery 工具提示给了我http://flowplayer.org/tools/tooltip/index.html(已经使用他们的可滚动插件有一段时间了,真的很喜欢它:)
从他们的网站:
jQuery Tooltip 允许您完全控制工具提示何时出现
显示或隐藏。可以为不同类型指定不同的事件
的元素。您可以通过事件控制此行为
配置变量默认有以下值:
events: {
def: "mouseenter,mouseleave", // default show/hide events for an element
input: "focus,blur", // for all input elements
widget: "focus mouseenter,blur mouseleave", // select, checkbox, radio, button
tooltip: "mouseenter,mouseleave" // the tooltip element
}
使用“点击”应该可以解决问题。 (我没有测试过)
但是,如果所有其他方法都失败,您仍然可以使用“脚本 API”来伪造它,只需调用 .show() 和 .hide()
Edit:
由于单击,单击并不完全像我想象的那样工作,我为您提供了一个解决方法。
我真的希望有一种更好的方法来达到相同的结果。
我用本地副本测试了它http://flowplayer.org/tools/tooltip/index.html它按预期工作。
var tooltip = $("#dyna img[title]").tooltip({
events: {
def: ",", // default show/hide events for an element
tooltip: "click,mouseleave" // the tooltip element
},
// tweak the position
offset: [10, 2],
// use the "slide" effect
effect: 'slide'
// add dynamic plugin with optional configuration for bottom edge
}).dynamic({ bottom: { direction: 'down', bounce: true } });
tooltip.click(function() {
var tip = $(this).data("tooltip");
if (tip.isShown(true))
tip.hide();
else
tip.show();
});
但我建议你也看看user834754建议的qTip,你可能会更喜欢它。