【问题标题】:Wrong webkit-tap-highlight-color behavior when page as web standalone app当页面作为 Web 独立应用程序时出现错误的 webkit-tap-highlight-color 行为
【发布时间】:2012-02-06 07:52:15
【问题描述】:

我正在尝试使用 css 删除 iPad 中网页点击时的突出显示

-webkit-tap-highlight-color: rgba(0, 0, 0, 0)

这在我的 iPad2 中直接使用浏览器时效果很好。但是,如果我将页面移动到带有漂亮大图标的 Web 应用程序,则该行为不再起作用。怪不?

设置

document.documentElement.style.webkitTouchCallout = "none";

正如this question 中指出的那样不起作用

欢迎提出一些想法和提示

【问题讨论】:

  • 您是否尝试将 -webkit-tap-highlight-color 和 -webkit-touch-callout 应用于全局 (*) 选择器?编辑:显然,因为它指向你所指的问题:)
  • 高亮是,触摸标注不是。我会尝试,但奇怪的想法是这只是当页面是一个网络应用程序时。有时间我会尝试(我们有一个演示,我现在不想重置安装)。
  • 抱歉耽搁了,没有解决问题

标签: javascript ios ipad ios5 iphone-standalone-web-app


【解决方案1】:

-webkit-tap-highlight-color-webkit-user-select 的组合对我有用。您可以将这些应用到单个元素,或html

html {
    -webkit-tap-highlight-color: rgba(0,0,0,0); 
    -webkit-user-select: none;
}

【讨论】:

    猜你喜欢
    • 2014-01-18
    • 1970-01-01
    • 2015-04-09
    • 2012-01-21
    • 2011-11-22
    • 2013-06-21
    • 2016-11-26
    • 1970-01-01
    • 2012-02-11
    相关资源
    最近更新 更多