:active doesn't work on PhoneGap
-
27-10-2019 - |
Question
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?
Solution
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?
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow