jQuery tipsy插件 - DelayIn无法正常工作

时间:2010-08-17 22:13:57

标签: jquery tooltip

我刚刚在我的网站上添加了jquery tipsy插件,我似乎无法让它正常工作!它消失得很好,html工作正常,但延迟不会发生。这是我正在使用的代码:

$(document).ready(function() {

$('#navi li a').tipsy({delayIn: 500, fade: true, html: true});

})

有没有人遇到过这个问题?此处页面的链接:failing demo

2 个答案:

答案 0 :(得分:4)

下载包(0.1.7)与演示页面上使用的代码不同。我手动复制了演示页面中的代码(tipsy.css,tipsy.gif和tipsy.jquery.js),现在一切正常。如果您使用juerypage中提供的包,则不能使用延迟和偏移参数。

答案 1 :(得分:3)

如果您阅读了Matt Wiz网站的源代码,您会注意到他使用的技术。他用于醉意的选项是

$('a.yes').tipsy({delayIn: 500, title: 'rel', fade: true, html: true}); 

和HTML

<a rel="&lt;b&gt;In This Section&lt;/b&gt;&lt;br/&gt;&lt;br/&gt;
We have plenty of ways you can help our cause! 
Check out this page for more information about how you can help 
&lt;span style=&quot;font-weight:bold;color:#ff6600&quot;&gt;The Change Exchange&lt;/span&gt; in our endeavors." 
id="howcanihelp" href="http://setarecord.com/tce/how-can-i-help/" class="yes" 
style="background-position: 0px 0px;" original-title="">
<span>How Can I Help?</span><span class="hover" style="top: 53px;"></span></a>

它像罪一样丑陋,读起来非常不愉快(注意:原始代码没有所有这些行间距)并且最重要的是,它的可怕的无效HTML。只是不要这样做。还有其他jQuery工具提示插件,您可以在不必将所有HTML数据粘贴到属性中的情况下执行此操作,好吗?

相关问题