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

What is Framer? Join the Community
Return to index
Amy Casillas
Posted Jan 24 - Read on Facebook

Is there a way to stop all animations that are currently running? I have a layer that is superLayer to a number of layers, and there are animations running on each of them. I'm trying to find a way to stop all of them at once without directly calling each one that may be running.


Joshua Tucker

Maybe try superLayer.animateStop(). If not, here are some other options:

I think I saw Ed Chao do this; create a function that stops the layers you want to stop at any given time and then call it when needed. Example:

stopAnimation = ->

And then call stopAnimation() in your code when needed.

Looking at the source, the other option you have is creating a for loop through all your layers in the superLayer and having an if statement asking if the layer is animating, and then call animateStop() on it.

Andreas Wahlström

Regarding the last approach: there's a relatively new property called layer.isAnimating that you can use in the if statement.

Read the entire post on Facebook