I need to animate a <div>
. Tried using @keyframes and transition.
Here's a code:
TRANSITION
#menu{
...
width:70%;
-webkit-transition: width 5s;
..
}
KEYFRAMES
#menu{
...
width:70%;
animation: menuEffect 3s;
..
}
@keyframes menuEffect
{
from {width:0%;}
to {width:70%;}
}
I'm using cordova/phonegap 2.0.0 and targeting android 4.0 and above. I do not see this working. Does transition and animation not support phonegap? Please assist.
Just don't forget to prepend -webkit-
to the css properties. It fixed all the problems for me.
This code worked in my case:
/* Animation element id */
#animate {
position: absolute;
top: 100px;
left: 100px;
-webkit-animation: move 1s ease infinite;
}
@-webkit-keyframes move {
50% {
-webkit-transform: translate(100px, 100px);
}
}
You can also use 'from, to' and it would just work fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With