This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Scott Savarie
Posted Dec 05 - Read on Facebook

Is there anyway of animating multiple elements together in such a way:

element1, element2, element 3.animate({
properties: {x: 10},
curve: animationCurve
})

3 Comments

Josh Puckett

Just make a function that accepts a view and animates it, and then call that function for all your views. If you have a lot of views, you should probably loop over them vs calling them one by one.

function mover(view) {
animation1 = new Animation({
view:view,
properties:{x:10},
curve: "spring(300,25,100)",
});
animation1.start();
}

mover(view1);
mover(view2);
mover(view3);

Scott Savarie

Ah great! Thanks Josh

Aaron Carámbula

I actually do the opposite. I tend to have a function that sets up similar views and gives them local functions for things like animating. So I end up calling view.mylocalfuncfion() and that can do lots of stuff in addition to animate.

Read the entire post on Facebook