trying to use jquery tooltip plugin, object has no method “tooltip”

前端 未结 3 1539
不知归路
不知归路 2020-12-20 20:28

I\'m using this tooltip: http://flowplayer.org/tools/demos/tooltip/index.html

I have the following lines in my html file:



        
相关标签:
3条回答
  • 2020-12-20 20:46

    Wrap $("#boo img[title]").tooltip(); in $(function(){ }); so you end up with:

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

    Why:

    The $(function()... is a short cut to execute that code on the domReady event. So at that point all of the jquery files, and the page, will be loaded far enough for your javascript to work.

    0 讨论(0)
  • 2020-12-20 20:56

    You should reorder your js files:

    <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>
    

    A little more explanation for anyone else having this problem:

    Scripts are loaded in the order they're called, so you want to load jQuery first, then any plugins, then your custom code.

    0 讨论(0)
  • 2020-12-20 21:02

    Got this problem too, and it was because of an old version of jquery lost in the sources folder, was jquery v1.6.2. If it can help someone... Have a nice day!

    0 讨论(0)
提交回复
热议问题