【问题标题】:Input text doesn't get enabled on mouseclick鼠标单击时未启用输入文本
【发布时间】:2015-09-09 16:10:04
【问题描述】:

当用户点击表单的中心,或文本区域的右侧(右侧的登录表单)时,什么都不会发生。只有当用户单击这些区域的左侧时,它才会起作用。这是我的jsFiddle

这是表格:

<form id="login" name="login">
    Username<input type="text" name="userid" size="25"/>
    Password<input type="password" name="pswrd"/>
    <input type="button" onclick="check(this.form)" value="Login"/>
    <input type="reset" value="Cancel"/>
</form>

如何让它在用户点击文本区域的任何一侧时启用?

【问题讨论】:

  • 无法在 Chrome 44 (Mac OS X) 上复制。
  • 我在 Chrome 45.0.2454.85 m (win7) @AaronCritchley.

标签: jquery html css jquery-mobile input


【解决方案1】:

样式表中的最后一件事是:

input {
    width: 10% !important;
}

一起摆脱规则,它会起作用。不需要。

【讨论】:

    【解决方案2】:

    试试这个:

    改变:

    input {
        width: 10% !important;
    }
    

    到:

    input {
        width: 100% !important;
    }
    

    小提琴:http://jsfiddle.net/dxzfbfpf/1/

    【讨论】:

      【解决方案3】:

      CSS 中的最后一项是

      input {
          width: 10% !important;
      }
      

      删除或覆盖:

      .ui-input-text input {
          width: 100% !important;
      }
      

      【讨论】:

      • 正确,+1,但另一个答案快了一分钟。
      • 他们都错了,你根本不需要规则! :)
      • @JohnFable,这就是为什么我说“删除它或覆盖”。我认为 OP 需要应用程序中其他地方的规则...
      猜你喜欢
      • 2012-04-16
      • 1970-01-01
      • 2022-07-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-27
      • 1970-01-01
      相关资源
      最近更新 更多