3

jQuery 関数 addClass および removeClass を使用して Internet Explorer (IE) の div タグの外観を変更すると、これらの関数が正しく機能しません。ただし、他のブラウザでは問題なく動作します。

私の問題を説明するためのサンプルコードは次のとおりです。

if ($('#tdh').hasClass('current')){
    $("#u50").addClass('u59c');
    $("#u59").addClass('u59b');
    $("#u61").removeClass('u59b');
}

CSS:

.u59b {
    background-color: #3B5998;
    color: #FFFFFF;
    font-family: Segoe UI Light;
    font-style: normal;
    font-weight: bold;
    padding-right: 13%;
    text-decoration: none;
    width: 196px;
}

.u59c {
    color: #3B5998;
    font-family: Segoe UI Light;
    font-style: normal;
    font-weight: bold;
    padding-left: 10%;
    text-decoration: none;
}

HTML

            <a href="Page/tdh.aspx" id="tdh" class="current">
            <div id="u59" class="u59 u124-pad">
               Title1
            </div>
            </a>
            <a href="Page/tdh2.aspx" id="tdh2">
            <div id="u63" class="u59 u59b u124-pad">
                Title2
            </div>
            </a>
4

3 に答える 3

0

con ExtJs: class: 'xxx-readonly', se supone que ya tiene esta clase el input, es necesario poner otra vez el foco (senderField.focus(true, 12)), para IE, y para los otros navegadores, esto no問題があります。

--英語で編集--

with ExtJs : class: 'xxx - readonly ' には、この種の入力が既にあるはずです。フォーカスする必要があります (senderField.focus (true , 12)) 。 .

field.addListener('focus', function(senderField){
    this.readOnly = this.el.dom.readOnly = false;
    this.getActionEl().removeClass('xxx-readonly');
    senderField.focus(true, 12);
});
于 2015-05-04T04:37:47.300 に答える