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

What is Framer? Join the Community
Return to index
Jairo Avalos
Posted Jun 04 - Read on Facebook

PageComponents giving me issues. Trying to get to the next page when a label is tapped. Everything but the snapping to next page happens. Any insights?

# Create PageComponent
pageComponent = new PageComponent
width: Screen.width, height: Screen.height - 240
scrollVertical: false, scrollHorizontal: false,
backgroundColor: "#262626"
y:sketch.navBar.height

# Create City List Scroll Component
cityListPage = new ScrollComponent
width: Screen.width
height: Screen.height - 240
scrollHorizontal: false
contentInset: {top: -128, bottom: 10}
superLayer: pageComponent.content

# Create team list ScrollComponent
teamListPage = new ScrollComponent
width: Screen.width
height: Screen.height - 240
scrollHorizontal: false
contentInset: {top: -128, bottom: 10}
x:cityListPage.width

# Create game list ScrollComponent
gameListPage = new ScrollComponent
width: Screen.width
height: Screen.height - 240
scrollHorizontal: false
contentInset: {top: -128, bottom: 10}
x:teamListPage.x + teamListPage.width

# Add content to scroll layer
sketch.cityList.superLayer = cityListPage.content
sketch.teamList.superLayer = teamListPage.content
sketch.gameList.superLayer = gameListPage.content

# Add lists as pages
pageComponent.addPage(teamListPage)
pageComponent.addPage(gameListPage)

# Move to next page on tap
sketch.bayAreaMetroLabel.on Events.Click, ->
cityLabel.animate
properties: {opacity:0}
curve: "spring(400,25,0)"
teamLabel.animate
properties: {x:180, opacity:1}
curve: "spring(400,25,0)"
pageComponent.snapToNextPage()