使用标题标签配置Tipsy

时间:2012-07-09 20:13:41

标签: javascript jquery tooltip tipsy

我已经尝试在我的网站上实现Tipsy jQuery插件,这意味着将标题标签显示为漂亮的工具提示。但它似乎没有在我的网站上工作,任何人都可以帮忙吗?

当我将鼠标悬停在视频广告连播中的视频缩略图上时,我想要显示工具提示...

1 个答案:

答案 0 :(得分:1)

您正在使用以下行初始化工具提示:

$('.tipsy').tipsy();

但正如您所看到的,以下img链接没有名为tipsy的类。

<a class="videobox various iframe" href="http://www.youtube.com/embed/I7_iD31Yhjg?autoplay=1&hd=1">
    <img width="74" height="56" title="Fear of Mobs Episode 155 - Murdering Ze Puppeh Doggies" src="http://i.ytimg.com/vi/I7_iD31Yhjg/1.jpg">
</a>

更新:尝试将$('.tipsy').tipsy();修复为$('a.videobox img').tipsy();

如果您想更改工具提示文本的位置,可以使用以下内容。

$('.tipsy').tipsy({
    title: 'alt' // it'll get the alt attr, you can use an attr or a callback
});
相关问题