【问题标题】:Options in the jquery-ui tooltip function does not having any affect on tooltipjquery-ui 工具提示功能中的选项对工具提示没有任何影响
【发布时间】:2015-03-02 09:59:54
【问题描述】:

我正在尝试将 jQuery-ui 工具提示添加到我的 rails 应用程序。

按照给定的示例,我配置了我的 javascript。我正在尝试使用下面提到的两个选项。但似乎没有一个有效。

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

我得到了一个工具提示,但它是非常简单的工具提示,带有简单的黑色背景,我指定的选项对工具提示没有任何影响。

【问题讨论】:

  • 尝试使用类选择器而不是文档
  • 我已经尝试使用类访问,并且元素的 id 和工具提示即将到来,但这里的问题是,工具提示函数中指定的选项根本不会影响工具提示,所以我无法定位我的工具提示,我无法为我的工具提示启用跟踪选项。

标签: javascript jquery ruby-on-rails jquery-ui jquery-ui-tooltip


【解决方案1】:

你能发布这个问题的 jsfiddle 或 codepen 吗?很乐意为您提供帮助。如果您的项目有工具提示类,这应该可以工作:

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

还要确保在工具提示项上设置了 title 属性,或者您在 .tooltip({}); 中设置了 content: ""选项。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-12-12
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多