【问题标题】:Can I clear the focus from a touched div on a mobile?我可以从手机上触摸的 div 中清除焦点吗?
【发布时间】:2012-04-30 21:20:08
【问题描述】:

我有一个用于桌面和移动设备的页面,其中包含允许用户触摸并按住它们进行调整的按钮。 This jsfiddle 说明了这种行为。

问题在于,在我的 Android 手机上,作为按钮的 div 会以焦点突出显示。然后它将不再响应触摸事件,直到焦点从它身上移开(通过按下另一个按钮)并返回到它。

是否可以清除或禁用元素的焦点?

【问题讨论】:

    标签: javascript jquery android mobile


    【解决方案1】:

    可以选择 e.preventDefault 吗?

    【讨论】:

      【解决方案2】:

      你可以试试 $("#id").blur(),或者只是专注于其他东西,比如 $("#otherid").focus()

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2015-12-27
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2010-11-08
        • 1970-01-01
        • 2017-02-04
        • 1970-01-01
        相关资源
        最近更新 更多