mozilla firefox中禁用的html按钮不会显示工具提示
Mozilla Firefox不会显示禁用控件的工具提示。还有其他方式显示它们吗 我更喜欢不使用javascript的解决方案 我可以找到一个简单的方法,就是改变css样式mozilla firefox中禁用的html按钮不会显示工具提示,html,firefox,button,tooltip,disabled-control,Html,Firefox,Button,Tooltip,Disabled Control,Mozilla Firefox不会显示禁用控件的工具提示。还有其他方式显示它们吗 我更喜欢不使用javascript的解决方案 我可以找到一个简单的方法,就是改变css样式 button, input { position: relative; width: 200px; } button[disabled]:hover:before, input[disabled]:hover:before { position: absolute; top: 10px;
button,
input
{
position: relative;
width: 200px;
}
button[disabled]:hover:before,
input[disabled]:hover:before
{
position: absolute;
top: 10px;
left: 10px;
content: attr(title);
background-color: #ffffe1;
color: #000;
line-height: 10pt;
font-size: 8pt;
border: 1px solid #000;
z-index:10000;
padding:2px;
}
对于button元素,这很好,但对于输入类型button控件/元素不起作用。尝试使用javascript工具提示添加动态html工具提示。这样,您就不需要依赖不同的浏览器如何为禁用的html元素呈现工具提示。类似:
code
//在firefox浏览器中显示禁用按钮的工具提示。$(window).load(function(){if($.browser.mozilla){$(“input”).each(function(){if((this.type==“button”| | this.type==“submit”)&&this.disabled){var wrapperSpan=$(“”);wrapperSpan.css({position:“relative”});$(this.wrapperSpan);var span=$(“”);span.attr({“title”:this.title,“class”:“disabledbuttonoltipspan”});$(this.parent().append(span);}}}}});。禁用按钮OLTIPSPAN{位置:绝对;z索引:1010101010;显示:块;宽度:100%;高度:100%;顶部:0;}