开发者

jquery ui disabled button unwanted text shadow in IE

I have link which is a Jquery UI style button. When I set disabled="disabled" ie8 renders the text with a white drop shadow. I can't tell where it is getting this style from. I have inspected the <a> tag, and it's two <span> children with ie dev tools and there are no styles which seem to relate to this.

I also looked through the UI stylesheet for any filter: or dropshadow properties, but alas there were none.

I also tried overriding the style even though I couldn't be sure where it was coming from, with:

开发者_如何学C
a.ui-state-disabled {

color:black !important;

}

But to no avail. Any suggestions?


This has nothing to do with jquery-ui. IE adds its own style to links with attribute disabled="disabled". It can't be overridden.


Adripants is right.It can't be overridden, but you have another way to do it:

First: Add your custom disable style to your css stylesheet

a.disabled {
    color:black;
}

Then: Remove the "disabled" attribute and add your custom class only for IE

<!--[if IE]>
<script type="text/javascript">
    $(function () {
        $("a:disabled, a[disabled='disabled']").addClass("disabled").removeAttr("disabled");
    });
</script>
 <![endif]-->


You can do one thing:

<button class="disabled" onmousedown="return checkDisable();">

function checkDisable() {

        if($(this).hasClass('disabled') { return false;}
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜