2

I am trying to have an element scale up from 0 on page load, but that element needs to be rotated. Seems like a simple thing, but it seems to apply the rotation after the animation finishes:

@-webkit-keyframes scale{
    0%{-webkit-transform: scale(0);}
    100%{-webkit-transform: scale(1);}
}
div{
    -webkit-transform: rotate(30deg);
    -webkit-animation: scale 2s;
}

http://jsfiddle.net/mildfuzz/wnpVp/

8
  • or opera, no, you're right. Not sure how that helps, though. Commented Jun 19, 2013 at 20:46
  • 1
    in the whole earth didn't you get any other word than scale to name your animation Commented Jun 19, 2013 at 20:49
  • 1
    What's your point? @Ankit, you seem to either be misunderstanding the problem or being purposely antagonistic. Commented Jun 19, 2013 at 20:51
  • 1
    Scale is a css property and no need to get aggressive Commented Jun 19, 2013 at 20:52
  • 1
    @Ankit I am sure you can handle changing some prefixes if you really can't fire up a webkit browser. As a rule, I always dev for webkit prefixes first, and then add support for others later, to keep code readable. Commented Jun 19, 2013 at 20:59

1 Answer 1

2

You need to use the transform shorthand within the @keyframes rule, as your rotate() function is outside the rule and thus not animating like you expected.

http://jsfiddle.net/wnpVp/3

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.