-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
translate property with relative percentage do not work #214
Comments
Thanks for pointing this. |
This doesn't seem to be working for me in the latest version. If I have an element with like so: .my-el {
transform: translateY(20%);
} and do something like anime({
targets: ".my-el",
translateY: "-=5%"
}) i expect it to have a |
I have the same problem. .my-el {
transform: translateX(-40%);
} anime({
targets: ".my-el",
translateX: "-=60%"
}) Target starts animating at Edit: Btw, for consecutive calls, it seems to work correctly. So somehow anime.js seems to mess up reading the initial value under certain circumstances. After that it works. @syropian did you ever get this to work? |
It's not working for me either. Here's a (an ugly) workaround I'll share for future readers until this gets fixed (hopefully). Just specify which values are going to be animated (e.g., the translateX value) and then just add its initial value as a variable on the root element, then get and set it with your anime.js just as you could target any other JavaScript variables (i.e.: link). I tried this and it works. |
Hello,
As title, here's my code:
Is it a bug or expected behavior?
The text was updated successfully, but these errors were encountered: