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

What is Framer? Join the Community
Return to index
Dae Hyuk Yoon
Posted Sep 17 - Read on Facebook

How do I repeat multiple animations together? Basically I want a layer to scale up and down and fade in and out while pressed.

14 Comments

Mike Feldstein

You'll want to chain animations together using the Events.AnimationEnd event. Here is an example: http://codepen.io/msfeldstein/pen/KBCwu

I see this asked a lot, perhaps this is a good sketch to add on the sites Examples page?

Aaron Carámbula

cc Brandon Souba

Fran Pérez
Dae Hyuk Yoon

Thanks, I'll give these a try.

Seoh Char
Daniel Lin

Hey Mike, Fran, and Cha, how do you set up CodePen to work with Framer.js?

Mike Feldstein

Click on the little gear next to JS and add Framer as an external script. You can find the latest build at builds.framerjs.com, or just use http://builds.framerjs.com/06a4df9/framer.js

Mike Feldstein

or just fork my codepen and start editing.

Daniel Lin

Oh AWESOME! I thought I'd need to upgrade to PRO or something haha. Thank you, Mike!

Dae Hyuk Yoon

So I finally made this to work but now I can't stop the loop. I thought layer.animateStop() would work but it doesn't. Any idea?

Mike Feldstein

Got a codepen?

Dae Hyuk Yoon

I don't. But here's my looping code

SoundVisual.states.on(Events.StateDidSwitch, function(){
if (SoundVisual.states.current === "brighter") {
return SoundVisual.states.switch("default");
} else {
return SoundVisual.states.switch("brighter");
};
});

Seoh Char

you can remove listeners of certain event like `layer.states.removeAllListeners`. and a certain listener also. i just write something in fast and dirty http://codepen.io/seoh/pen/JBoHn

Dae Hyuk Yoon

Thanks Cha, but I wonder if there's an alternative way to do this without adding and removing a state for every click. I thought switching to third state will take me out of the loop since the loop only works when switching between two states. But this didn't work.

Read the entire post on Facebook