我正在使用Drew Wilsons Tip Tip Plugin和修改后的方法来“显示”,“隐藏”或“摧毁”TipTip ......
出于某种原因,我无法将所有工具提示显示在准备就绪的文档上,但它们不会出现我想知道是否有人可以引导我朝着正确的方向......这是我的代码......
jQuery的:
jQuery(document).ready(function($) {
$(".botpage a").tipTip({ content: "This is an anchor tag!"});
$(".botpage a").tipTip('show');
});
TipTip默认值
var defaults = {
activation: "hover", // How to show (and hide) the tooltip. Can be: hover, focus, click and manual.
keepAlive: false, // When true the tooltip won't disapper when the mouse moves away from the element. Instead it will be hidden when it leaves the tooltip.
maxWidth: "200px", // The max-width to set on the tooltip. You may also use the option cssClass to set this.
edgeOffset: 6, // The offset between the tooltip arrow edge and the element that has the tooltip.
defaultPosition: "bottom", // The position of the tooltip. Can be: top, right, bottom and left.
delay: 400, // The delay in msec to show a tooltip.
fadeIn: 200, // The length in msec of the fade in.
fadeOut: 200, // The length in msec of the fade out.
attribute: "title", // The attribute to fetch the tooltip text if the option content is false.
content: false, // HTML or String or Function (that returns HTML or String) to fill TipTIp with
enter: function () { }, // Callback function before a tooltip is shown.
afterEnter: function () { }, // Callback function after a tooltip is shown.
exit: function () { }, // Callback function before a tooltip is hidden.
afterExit: function () { }, // Callback function after a tooltip is hidden.
cssClass: '' // CSS class that will be applied on the tooltip before showing only for this instance of tooltip.
};
HTML
<div class="botpage">
<a>TOOLTIP YAY!</a>
</div>
我做错了什么???如果您需要任何其他代码,请告诉我们!
答案 0 :(得分:0)
有一个束的jQuery工具提示插件。我认为最流行的一个是qtip。以下是如何在qTip中执行此操作的示例:http://jsfiddle.net/GEycz/