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

What is Framer? Join the Community
Return to index
Hugo des Gayets
Posted Jul 01 - Read on Facebook

Hello Experts! Quick question about PageComponent:

I have pages, each one has an object that starts animating infinitely when "page.currentPage == intendedPage".

Everything works well, but once you’re done swiping every pages, every object are now animating in an unstoppable loop :(

Is there a way to stop animating on every "page.change"? Objects would restart animating only when page.currentPage == intendedPage.



Eelco Lempsink

Hi Hugo – you can stop animations by calling ‘stop()’ on them. For this you either have to use Animation objects or to gather the animations from a layer. Example: (click the square to stop the animation)

Hugo des Gayets

Thanks Eelco Lempsink ! In fact you're right but what is the event to call for a PageComponent page change?

Hugo des Gayets

eg: page.onPageChange () -> animation.stop()

Eelco Lempsink

page.on "change:currentPage", -> …

Hugo des Gayets

That is indeed what I set initially... Weird. Thanks man!

Read the entire post on Facebook