简体   繁体   English

提示工具提示不起作用

[英]Tipsy tooltip is not working

In this page , I have implemented tipsy tooltip, jbgallery two jquery plugins. 此页面中 ,我已经实现了技巧性的工具提示,jbgallery两个jquery插件。 You can observe tool tip appears when you rollover logo, i have written the same for icons appearing right bottom of the page ie (Tag, Facebook, Twitter icons etc...) can any one help me in this please... 您可以观察到鼠标悬停徽标时出现工具提示,我为出现在页面右下角的图标写了相同的提示,例如(标记,Facebook,Twitter图标等),任何人都可以在此帮助我...

It seems like you are missing the class .tooltip on those anchor tags. 似乎您在这些锚标记上缺少类.tooltip Try adding them in and see if it works. 尝试将它们添加进去,看看是否可行。 Eg: 例如:

<a href="#" class="twitter tooltip">twitter</a>

* EDIT * * 编辑 *
Replace the $ with jQuery and replace $(function(){ with jQuery(document).ready(function(){ $替换$ jQuery并将$(function(){替换$(function(){ jQuery(document).ready(function(){



* EDIT * * 编辑 *
Try this: 尝试这个:

$('.tooltip').each(function(){
    $(this).tipsy({fade: true});
});

and I think the tipsy is reading the original-title attribute in your case to display title.which is missing in (Facebook, Twitter anchor tags.) 而且我认为这个棘手的人正在阅读您案例中的original-title属性以显示title。(Facebook,Twitter锚标签中缺少)。

I copy this code from your given url. 我从您指定的网址复制此代码。 just inspect the elements where I found a little difference in your both places where you added tipsy class. 只需检查一下在您添加了Tips类的两个地方我发现有点不同的元素。

[original-title is available here.]
<a href="#" class="tooltip" original-title="test">
<img src="images/logo.png" alt="" title="">
</a>

[attribute missing original-title here]
<a href="#" class="tooltip twitter" title="Twit Icon">twitter</a>
<a href="#" class="tooltip facebook" title="FB Icon">facebook</a>

How are those buttons getting into the DOM? 这些按钮如何进入DOM? If I run your tooltip activation code on the console: 如果我在控制台上运行您的工具提示激活代码:

 $('.tooltip').tipsy({fade: true});

then it shows me it has added the tipsy function to the icons (and hovering works). 然后它向我显示它已在图标中添加了提示功能(并且进行了悬停)。

I don't think the DOM is properly loaded when your bit of script runs. 我认为当您运行一些脚本时,DOM加载不正确。 Stick it at the bottom of the page, or in a jQuery(document).ready(function(){ block 将其粘贴在页面底部或jQuery(document).ready(function(){块中

When I add a container class(.jbg-caption) in selector, it works. 当我在选择器中添加容器类(.jbg-caption)时,它可以工作。 Please try to replace with the following code. 请尝试替换为以下代码。

$(function() {
$('.tooltip').tipsy({fade: true});
}); 

to

$(function() {
$('.jbg-caption a.tooltip').tipsy({fade: true});
}); 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM