【问题标题】:Missing cursor in form text boxes in Firefox 23Firefox 23 中的表单文本框中缺少光标
【发布时间】:2013-08-22 06:10:55
【问题描述】:

我在 Firefox 上遇到问题,我在表单的文本框中看不到光标。这可以在 Firefox 22 上看到,自从我今天早上升级后,23.0.1。

这在 Chrome 或 IE 中不会发生,并且似乎是 Firefox 特有的问题,但通过从 Firebug 中的表单字段中删除样式,我似乎无法缩小范围。

我的一个表单域:

<input type="text" autocomplete="off" value="" id="CardNum" name="CardNum" class="textbox">

应用于该表单域的 CSS:

.input_box_shadow, .standard_form textarea, .standard_input, .standard_form input {
    background: -moz-linear-gradient(90deg, #EDECEC, #DDDDDD) repeat scroll 0 0 border-box #F4F4F0;
    border: 1px solid transparent;
    border-radius: 3px 3px 3px 3px;
    box-shadow: 0 0 3px white, 0 0 12px #F4F4F0 inset, -999px 0 0 #F4F4F0 inset;
    outline: medium none;
    transition: all 0.2s linear 0s;
}
.standard_input, .standard_form input {
    color: #434242;
    font-size: 1.05rem;
    height: 22px;
    letter-spacing: 0.1rem;
    padding-left: 5px;
    width: 230px;
}
button, input {
    line-height: normal;
}
button, input, select, textarea {
    font-size: 100%;
    margin: 0;
    vertical-align: baseline;
}

【问题讨论】:

  • 一个 jsfiddle 可能很有用。
  • 刚刚检查了您在 Mac 上的 Firefox 23.0.1 中发布的代码,它运行良好...

标签: forms firefox cross-browser css


【解决方案1】:

我已经将此追溯到我的代码,以下是罪魁祸首。

$('form').on('focus','li', function(event) {
    if($(this).closest('form').attr('id') == 'oform'){
       return false;
    }
    $(this).closest('form').find('li').css('zIndex', '0');
    $(this).css('zIndex', 1998);
});

我将return false; 更改为event.preventBubble = true;,这解决了Firefox 的问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-29
    • 2010-11-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多