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

What is Framer? Join the Community
Return to index
Văn Công Bằng
Posted Jul 17 - Read on Facebook

So, i have 3 pages(1-2-3), on every page there is a discard button, if i press the button, the current page is move up off the screen and the next page is move in the screen (from the right). I used states.switch for current page when pressing the button, after (Utils.delay) a time, page.snapToNextPage(). The problem is, if i am at page 3, page 2 is discarded (up off the screen), but page 1 is not, when discarding the 3, how do i make the page return to 1 which is not discarded ?

2 Comments

Benjamin Den Boer

Hey Văn Công Bằng - you can check whether or not the currentPage is the final page. Let's say you have your pages stored in an array as well. On Click, you can check if the currentPage is the final page (if page.currentPage is allPages[2]) - and then snap back to the first page instead. :-)

Văn Công Bằng

Thank you, actually, i'd known your logic, but i didn't know how to code, i guess i need to learn Js from scratch before going further

Read the entire post on Facebook