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

What is Framer? Join the Community
Return to index
Mike Paggi
Posted Mar 08 - Read on Facebook

I'm programmatically creating layers/pages in a Pagecomponent to cycle through in a carousel like way with some onboarding images. When it gets to the end I want it to start to the first page...the thing is I wanted to be smart and use a for-loop for this but the layer name is the same for all. changing the "name" property doesn't help here it still seems them separately. anyway i can tell it to go to the first page when i get to the last? I can get the currentPage.name reference but just can't apply it back to using that to snap to that page.

3 Comments

Sergey Voronov

https://framer.cloud/JWNMv/ by Jonas Treub :)

Mike Paggi

nevermind I got it :-)

Mike Paggi

Utils.interval 3, ->
if GettingStartedCarousel.currentPage.name is "GettingStartedPageTemplate3"
GettingStartedCarousel.snapToPage(GettingStartedCarousel.content.children[0])
else
GettingStartedCarousel.snapToNextPage()
print GettingStartedCarousel.currentPage.name

Read the entire post on Facebook