2012-09-10 67 views
0

我使用德魯威爾遜竅門插件與修改後的方法來「秀」,「隱藏」或「消滅」一個TipTip ...顯示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

「修改方法來」顯示「,」隱藏「或」銷燬「TipTip」你是否修改了方法來做到這一點? – aquinas

+0

我以爲德魯威爾森新版本已經有了這些修改......查看本頁:http://drew.tenderapp.com/discussions/tiptip/70-updated-tiptip-with-new-features – onei0120

+0

似乎爲我工作:http://jsfiddle.net/ygswQ/ – aquinas

回答

0

啊哈。我看到了這個問題。它顯示了一個工具提示。但它只顯示一個。看起來插件可能只允許您一次顯示一個插件。看到這個更新的小提琴:jsfiddle.net/ygswQ/1。因此,您可能需要修改源代碼或使用不同的工具提示插件來讓您這樣做。

有一個一堆 jQuery工具提示插件。其中一個比較流行的我認爲是qtip。下面是你如何在qTip中做到這一點的一個例子:http://jsfiddle.net/GEycz/