2014-07-09 66 views
0

我试图用这个工具提示: http://osvaldas.info/elegant-css-and-jquery-tooltip-responsive-mobile-friendly为什么这个jQuery工具提示不起作用?

下面是测试页面(在WooCommerce/WordPress的运行): https://blendbee.com/shop/uncategorized/test-product-2/

您可以看到“成分”下的“加载项”有下划线。如果您将鼠标放在它上面,则会显示标题,但jQuery工具提示不会显示。对于“成分”的HTML是:

<abbr title="Here's some info about this ingredient..." rel="tooltip">ingredient</abbr> 

在Chrome中检查我看到错误:

Uncaught TypeError: undefined is not a function

我认为它在页脚区域的JS功能做的,我是从拷贝工具提示页面,但我不知道如何解决它。

$(function(){ var targets = $('[rel~=tooltip]')... 

任何想法?

+0

你试图把你从工具提示页面的头部部分得到了JS? – V31

+1

@ V31 - 不会,因为剧本作者说身体更好。不用担心,下面的答案解决了它。 – Kane

回答

1

我在控制台 中看到$ is not a function,但它看起来像包含jQuery。

尝试改变

$(function(){...}); 

(function($) { 
     $(function(){...}); 
    })(jQuery);