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

What is Framer? Join the Community
Return to index
Sherwin Dai
Posted Oct 15 - Read on Facebook

Guys, is there a way to trigger animation when scroll to a specific page? I am using PageComponent, but it seems there is no specific events associated with PageComponent function?

5 Comments

Benjamin Den Boer

Hey Sherwin Dai - you can check for the currentPage within the "change:currentPage" event to trigger an animation when viewing a specific page. Say one of your page layers is titled "homePage", then you could write the following:

page.on "change:currentPage", ->
____if page.currentPage is homePage...

Sherwin Dai

Thank you for the explanation, will try tonight

Madoka Ochi

Sorry for jumping in: Is it possible to write "else if" under "page.on "change:currentPage", ->"?

Sherwin Dai

I actually use a list of parallel if statements to trigger animation when flipping to different pages, for example:

page.on "change:currentPage", ->
____if page.currentPage is page1...
...
____if page.currentPage is page2...
...
____if page.currentPage is page3...
...

No need to use else if on my case.

Madoka Ochi

I see. Thanks for replying! I haven't tried yet but will see what happens :)

Read the entire post on Facebook