0

I'm trying to animate a -webkit-transform rule. I tried:

element.children().animate('webkitTransform': "translate3d(200px, 0, 0)", 200);
element.children().animate('WebkitTransform': "translate3d(200px, 0, 0)", 200);
element.children().animate('-webkit-transform': "translate3d(200px, 0, 0)", 200);

What am I missing?

Applying the CSS without animation works fine:

element.children().css('-webkit-transform', "translate3d(200px, 0, 0)");

Animate also works if I animate a non prefixed property like margin-left, etc.

2 Answers 2

2

You can't animate this particular property since it is not numeric. Prefixes have nothing to do with that. From the docs:

All animated properties should be animated to a single numeric value, except as noted below; most properties that are non-numeric cannot be animated using basic jQuery functionality

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

Comments

1

That is invalid Javascript. The first parameter needs to be an object. I still don't believe you can animate this property even with the right syntax.

element.children().animate({webkitTransform: "translate3d(200px, 0, 0)"}, 200);

This article may be able to help you out, though: http://cameronspear.com/blog/animating-translate3d-with-jquery/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.