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

What is Framer? Join the Community
Return to index
Eldar Burnashev
Posted Aug 10 - Read on Facebook

[SOLVED] I have a function with looped animation. Is there a way to stop function on event?

2 Comments

Radek Kyselý

@animateStop()

And it's probably better to get rid of the interval. Instead, create looped animation using animation Events—meaning call the second animation on End of the first one and call first one on End of the second one :)

Ian McClure

You can assign your interval to a variable. You'll then be able to call .invalidate() and it should stop the interval.

Edit: I looked it up and removing intervals looks like this:

runLoop = Utils.interval 5, ->
//Do Stuff

clearInterval(runLoop)

Read the entire post on Facebook