【问题标题】:jQuery UI Tooltip only shown once when tabbing through using keyboardjQuery UI Tooltip 仅在使用键盘切换时显示一次
【发布时间】:2013-03-26 07:36:55
【问题描述】:

我已经使用 jquery ui 创建了一个工具提示,但是当我使用键盘导航时,工具提示内容只出现一次,再也不会出现。

任何想法为什么会发生这种情况?

$('.test').tooltip({
    tooltipClass: "tip-style",
    position: {
        my: "left center",
        at: "right center"
    },
    content: function() {
        return $('#tip-content').html();
    }
});

我的工作示例:http://jsfiddle.net/WQpGE/

【问题讨论】:

    标签: jquery jquery-ui accessibility keyboard-events jquery-ui-tooltip


    【解决方案1】:

    我认为这是因为工具提示文档说content: 方法应该是回调或字符串

    支持多种类型:

    Function: A callback which can either return the content directly, 
              or call the first argument, passing in the content, e.g., 
              for Ajax content.
    
    String: A string of HTML to use for the tooltip content.
    

    我通过创建一个命名函数并在内容方法中引用它来编辑您的代码。它似乎按预期工作。

    http://jsfiddle.net/WQpGE/3/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-14
      相关资源
      最近更新 更多