简体   繁体   English

jquery-ui工具提示函数中的选项对工具提示没有任何影响

[英]Options in the jquery-ui tooltip function does not having any affect on tooltip

I am trying to add a jQuery-ui tooltip to my rails application. 我正在尝试将jQuery-ui工具提示添加到我的Rails应用程序中。

By following the given example, I configured my javascript. 通过遵循给定的示例,我配置了JavaScript。 I am trying to use below mentioned two options. 我试图使用下面提到的两个选项。 But none seems working. 但是似乎没有一个工作。

$(document).tooltip({
    track: true,
    position: { 
      my: "center", 
      at: "center bottom" 
    }
  });

I got a tooltip but it was very simple tooltip with a simple black background and the options i specified was not making any affect on tooltip. 我有一个工具提示,但这是一个非常简单的工具提示,带有简单的黑色背景,我指定的选项对工具提示没有任何影响。

Can you post a jsfiddle or codepen of this issue? 您可以发布此问题的jsfiddle或Codepen吗? Would be happy to try to help you. 很乐意为您提供帮助。 This should work if your item has a tooltip class: 如果您的商品具有工具提示类,则此方法应该起作用:

$(".tooltip").tooltip({
    track: true,
    position: { 
      my: "center", 
      at: "center bottom" 
    }
});

Make sure also that the title attribute is set on the tooltip item or you set content: "" in your .tooltip({}); 另外,还要确保在工具提示项上设置了标题属性,或者在.tooltip({});中设置了内容:“”; options. 选项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM