【问题标题】::active doesn't work on PhoneGap:active 不适用于 PhoneGap
【发布时间】:2011-12-02 12:57:48
【问题描述】:

我想要一个<div>,当你触摸它时,它会慢慢改变其背景颜色。

我为此使用了 :active 伪类:

div {
    background: #fff;
    transition: all .3s linear;
    -o-transition: all .7s linear;
    -moz-transition: all .7s linear;
    -webkit-transition: all .7s linear; 
}

div:active {
    background: #E5CC00;
}

在 Chrome 上完美运行,但在 PhoneGap/Android 上无法运行。我也试过:hover

有什么想法吗?

【问题讨论】:

    标签: android html css cordova transitions


    【解决方案1】:

    :active 伪类不适用于 Android 上的 div 标签。它确实适用于锚标签。查看这个 StackOverflow 答案:

    How to simulate :active css pseudo class in android on non-link elements?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-06-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-03-05
      相关资源
      最近更新 更多