试图使用jquery工具提示插件,对象没有方法“工具提示”

我正在使用此工具提示http://flowplayer.org/tools/demos/tooltip/index.html

我的html文件中有以下几行:

<script src="/javascripts/home.js" type="text/javascript"></script>
<script src="http://cdn.jquerytools.org/1.2.6/jquery.tools.min.js" type="text/javascript"></script>
<script type="text/javascript" src="/scripts/jquery.min.js"></script>

<div id="boo">
<img src="image1.jpg" title="this thing is a tool"/>
<img src="image2.jpg" title="this thing is also tool"/>
</div>

我的home.js文件中有以下行:

$("#boo img[title]").tooltip();

我的css文件中有以下行:

.tooltip {
    display:none;
    background:transparent url(/tools/img/tooltip/black_arrow.png);
    font-size:12px;
    height:70px;
    width:160px;
    padding:25px;
    color:#fff; 
}

我收到此错误

Uncaught TypeError: Object [object Object] has no method 'tooltip'

我的智慧结束了.我觉得我已经完全按照网站上的例子,但不知道发生了什么.

解决方法

你应该重新排序你的js文件
<script type="text/javascript" src="/scripts/jquery.min.js"></script>
<script src="http://cdn.jquerytools.org/1.2.6/jquery.tools.min.js" type="text/javascript"></script>
<script src="/javascripts/home.js" type="text/javascript"></script>

对于遇到此问题的其他人,请多说一点:

脚本按照它们被调用的顺序加载,因此您希望首先加载jQuery,然后加载任何插件,然后加载自定义代码.

相关文章

页面搜索关键词突出 // 页面搜索关键词突出 $(function () {...
jQuery实时显示日期、时间 html: &lt;span id=&quot...
jQuery 添加水印 &lt;script src=&quot;../../../.....
中文:Sys.WebForms.PageRequestManagerParserErrorExceptio...
1. 用Response.Write方法 代码如下: Response.Write(&q...
Jquery实现按钮点击遮罩加载,处理完后恢复 思路: 1.点击按...