禁用按钮上的Jquery UI工具提示

我正在尝试显示禁用按钮的工具提示.我不确定jquery事件是否会激活已禁用的元素,但我正在尝试检查是否可以显示已禁用项目的工具提示.我的例子是here

disabled="disabled" title="This a test disabled button." value="hover me please">   ottom-20",at: "center top",using: function (position,Feedback) {
                $(this).css(position);
                $("Feedback.vertical)
                    .addClass(Feedback.horizontal)
                    .appendTo(this);
            }
        }
    });
});
最佳答案
看起来不能保证正常工作.

见文档(http://api.jqueryui.com/tooltip/):

In general,disabled elements do not trigger any DOM events. Therefore,it is not possible to properly control tooltips for disabled elements,since we need to listen to events to determine when to show and hide the tooltip. As a result,jQuery UI does not guarantee any level of support for tooltips attached to disabled elements. Unfortunately,this means that if you require tooltips on disabled elements,you may end up with a mixture of native tooltips and jQuery UI tooltips.

编辑:解决这个问题的一种方法是,不要将按钮设置为禁用,而是将其设置为样式,使其看起来像是已禁用.如果它是一个简单的按钮,那就是你所要做的,如果它是一个提交按钮,你还必须阻止它提交表单.

编辑#2:我尝试了上面的解决方法,看起来不透明:0.5几乎完成了工作(来源:tjvantoll.com):

.disabled-button {
    opacity: 0.5;
}

这是你更新的小提琴:http://jsfiddle.net/jkLzuh0o/3/

相关文章

页面搜索关键词突出 // 页面搜索关键词突出 $(function () {...
jQuery实时显示日期、时间 html: <span id=&quot...
jQuery 添加水印 <script src="../../../.....
中文:Sys.WebForms.PageRequestManagerParserErrorExceptio...
1. 用Response.Write方法 代码如下: Response.Write(&q...
Jquery实现按钮点击遮罩加载,处理完后恢复 思路: 1.点击按...