Internet Explorer上的“禁用”属性不会使复选框变暗 [英] Checkbox is not dimmed with 'disabled' property on internet explorer

查看:104
本文介绍了Internet Explorer上的“禁用”属性不会使复选框变暗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



尝试禁用复选框时遇到问题。



功能正常,复选框已禁用,但在IE用户界面中,它看起来并不像在Firefox或谷歌浏览器上那样暗淡



这是我的代码和它工作正常:



 $( #<%= chkTrueAnsRequired.ClientID%>)。change( function (){
var chkAllowText = $( #<%= ChkAllowText.ClientID%> ;);
if this .checked){
chkAllowText.attr( disabled true );
}
else {
chkAllowText.removeAttr( 已停用);
}
});







所以我的问题是要做到这一点在IE UI上变暗。

任何想法?

解决方案

#<%= chkTrueAnsRequired.ClientID%>)。change( function (){
var chkAllowText =


#<%= ChkAllowText.ClientID%>);
if this .checked){
chkAllowText.attr( disabled true );
}
else {
chkAllowText .removeAttr( disabled);
}
});







所以我的问题是要做到这一点在IE UI上变暗。

任何想法?


只需要做这个CSS技巧。你可以在这里设置 background-color 。 br />


输入[已禁用] {
...
/ * 这里的CSS * /
...
}







检查此链接Too: 设置禁用的CheckBox颜色



选中此项:的jsfiddle


Hi Guys,

I have a problem when trying to make check box disabled.

The functionality is working fine and the checkbox is disabled, But in the IE UI it doesn't look dimmed as on firefox or google chrome

that is my code and it works fine:

$("#<%=chkTrueAnsRequired.ClientID%>").change(function () {
                var chkAllowText = $("#<%=ChkAllowText.ClientID%>");
                if (this.checked) {
                    chkAllowText.attr("disabled", true);
                }
                else {
                    chkAllowText.removeAttr("disabled");
                }
            });




So My problem is to make it dimmed on the IE UI.
Any Ideas?

解决方案

("#<%=chkTrueAnsRequired.ClientID%>").change(function () { var chkAllowText =


("#<%=ChkAllowText.ClientID%>"); if (this.checked) { chkAllowText.attr("disabled", true); } else { chkAllowText.removeAttr("disabled"); } });




So My problem is to make it dimmed on the IE UI.
Any Ideas?


Just do this CSS trick.You can set background-color here.

input[disabled] {
...
/* CSS here */
...
}




Check this link Too : set the disabled CheckBox color

Check This one : JSFiddle


这篇关于Internet Explorer上的“禁用”属性不会使复选框变暗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆