Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/78.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
wordpress站点中的jQuery UI工具提示_Jquery_Wordpress_User Interface_Tooltip - Fatal编程技术网

wordpress站点中的jQuery UI工具提示

wordpress站点中的jQuery UI工具提示,jquery,wordpress,user-interface,tooltip,Jquery,Wordpress,User Interface,Tooltip,尝试获取使用图片而不是文本的工具提示。就我的站点中的文本而言 <a id="thisId" href="#" title="hello world" >ALOHA!</a> <script> jQuery(document).ready(function(){ jQuery( '#thisId' ).tooltip(); }); </script> jQuery(文档).ready(函数(){ jQuery('

尝试获取使用图片而不是文本的工具提示。就我的站点中的文本而言

<a id="thisId" href="#" title="hello world" >ALOHA!</a>

<script>
    jQuery(document).ready(function(){
        jQuery( '#thisId' ).tooltip();
    });
</script>

jQuery(文档).ready(函数(){
jQuery('#thisId')。工具提示();
});
这个很好用。。它在链接的悬停处显示“hello world”


但如果我尝试以下方法,但在我的WP网站上,它失败了,因为它没有显示任何内容。为什么会这样?

这主要是因为你的WordPress主题会自动使用具有自己工具提示的引导。它的工具提示也使用相同的函数tooltip(),因此这只是JQuery UI和引导之间的命名冲突

要解决此问题,可以强制重命名JQuery Ui中使用的tooltip()函数,如下所示:

jQuery.widget.bridge( 'jQueryUITooltip', jQuery.ui.tooltip );
从现在起,使用jQueryUITooltip()而不是tooltip()初始化JQuery UI工具提示,例如:

jQuery(document).ready(function(){
    jQuery( '#thisId' ).jQueryUITooltip({
       track: true
    });
});

控制台中有错误吗?@VidyaNair没有什么。。这有点奇怪。试着停用每个插件并检查它是否正常工作not@VidyaNair但它可以很好地处理文本。。。因此,只要工具提示()只显示title=“”属性,它就可以工作。我已经在我的本地wp网站上检查了你的代码,并且工作正常。确保控制台中没有错误,并且正在加载脚本