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

What is Framer? Join the Community
Return to index
Alex Miles
Posted Feb 01 - Read on Facebook

Is there a way to cancel a Utils.delay after it has been called?


Brandon Souba

Can you give more details on what you are trying to do?

Alex Miles

I call a function that contains utils.delay to delay an animation. If I click the screen again before the utils.delay occurs, I'd like to cancel the utils.delay and not run the animation behind the utils.delay.

I don't have my computer on me at the moment but I can post my code later. Just wondering if theres a way to cancel delays. Maybe something similar to clearTimeout()

Jordan Robert Dobson <- This should be a nice simple example for you.

Jordan Robert Dobson
Jordan Robert Dobson

I don't believe you can set the delay to a variable in which you cancel... you could always just use a setTimeout if you wanted.

Cemre Güngör

i thought utils.delay also outputted the same timer id variable

Jordan Robert Dobson

You know Cemre I never actually checked what it returns. :/

Read the entire post on Facebook