CSS transition or animation not working on the phone

I need to animate a <div>. Tried to use @keyframes and transition. Here is the 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 am using cordova / phonegap 2.0.0 and am targeting Android 4.0 and above. I do not see this working. Does transition and animation support telephone interchange? Please, help.

+5
source share
2 answers

Just remember to add the -webkit-css properties. He 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 this will work fine.

+9
source

With Phonegap, you need to use prefix versions of the properties because it is just Webkit.

-webkit-animation: menuEffect 3s linear

@-webkit-keyframes menuEffect
{
    from {
        width:0%;
    }
    to {
        width:70%;
    }
}
+4
source

All Articles