$(…).tooltip is not working since jQuery 1.9.2 is not working due to old jQuery UI 1.8.16 library? How to fix this?

杀马特。学长 韩版系。学妹 提交于 2019-12-24 13:41:32

问题


I'm working on a website which is built in some heavy PHP framework.

So it already has included jQuery UI 1.8.16 library. Now I have to implement $(...).tooltip functionality on one web page. This feature is not availabe in jQuery UI 1.8.16 but it is available in jQuery 1.9.2 .

<script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>

So I included following line into the HTML file where I want to implement the $(...).tooltip functionality. But still in firebug I got following error:

TypeError: $(...).tooltip is not a function

How to resolve this issue? Can someone please help me in this regard?


回答1:


You can download only Tooltip widget from jQuery UI - Download Builder.

To build a custom jQuery UI library, check the following items:

  • UI Core

    1. Core
    2. Widget
    3. Position
  • Widgets

    1. Tooltip
  • Theme (optionl)

Then load JS library after jQuery core as well as stylesheets.

After that you can simply initialize the widget.

$( "#tooltip" ).tooltip();

Here is a working example.



来源:https://stackoverflow.com/questions/28024304/tooltip-is-not-working-since-jquery-1-9-2-is-not-working-due-to-old-jquer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!