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

What is Framer? Join the Community
Return to index
Ryan Gambles
Posted Jul 16 - Read on Facebook

How do you go about tracking animation events on PageComponent.snapToPage()?

8 Comments

Chris Camargo

Have you tried:
PageComponent.on "change:currentPage"

Ryan Gambles

Yeah. It unfortunately fires right at the beginning of the transition.

Chris Camargo

You want to trigger something at the end of the transition?

Ryan Gambles

Yes'ir. It's proving to be slightly difficult to do properly, and i'd like to not have to resort to a timeout.

Chris Camargo

PageComponent extends the ScrollComponent, so its events may work. Have you tried Events.ScrollAnimationDidEnd or Events.AnimationEnd?

Ryan Gambles

Good point. Let me give it a try and report back.

Ryan Gambles

So it doesn't appear that page snaps fire scroll events. However, if you access PageComponent.content.animations() it will give you a list of the animations to listen for events on.

In my case, there will only ever be a single animation queued, so I can rely on that no problem. It'd be convenient in the future to be able to listen for the transition event directly on the page component itself, though.

Fran Pérez

Had the same problem last week, I ended up using a time out.

Read the entire post on Facebook