Skip to content
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

JAVASCRIPT Nested OBJECT #865

Open
AmirRafiee opened this issue Oct 3, 2023 · 1 comment
Open

JAVASCRIPT Nested OBJECT #865

AmirRafiee opened this issue Oct 3, 2023 · 1 comment

Comments

@AmirRafiee
Copy link

AmirRafiee commented Oct 3, 2023

i want to animate javascript object with nested object.
currently we can animate root properties but when we get deeper in to the object we cant animate the values.
i think this will be pretty handy if we were able to do such.

sample code :

var Rect= {
width: 100,
height: 100,
position: {
x: 10,
y: 10
}
}
anime({
targets: Rect,
width: 200,
height: 200,
"position.x": 100,
"position.y": 100,
round: 1,
easing: 'linear'
});

@juliangarnier
Copy link
Owner

This is not possible out of the box in JS, but maybe you can create a proxy object with getter and setter props that will update the original object?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants