简体   繁体   中英

:active doesn't work on PhoneGap

I'm trying to have a <div> that when you touch it, it slowly changes its background color.

I'm using the :active pseudo class for that:

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;
}

Works perfectly on Chrome, but doesn't work on PhoneGap/Android. I've also tried :hover .

Any ideas?

The :active pseudo class doesn't work on the div tag on Android. It does work on the anchor tag though. Check out this StackOverflow answer:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM