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

What is Framer? Join the Community
Return to index
Christian Poschmann
Posted Nov 13 - Read on Facebook

Question: I'm trying to change the background color of my background layer when switching to a specific page. What is the best way to do this?
I managed to change it when using
scroll.on "change:currentPage", ->
module.colourTransition(background, 'rgba(74, 164, 233, 1)', 0.4, 30)
Is there a way to say something around "if page 2 selected then backgroundColor is "..."

4 Comments

Chen Shuai

how about this:

Chen Shuai

set 2 states for background, while change the indicator, change the background state

Andrew Nalband

.
http://share.framerjs.com/ywk0etn1jbr9/
scroll.on "change:currentPage", ->
if scroll.currentPage.name is "card1"
module.colourTransition(background, 'rgba(122, 108, 225, 1)', 0.4, 30)
else if scroll.currentPage.name is "card2"
module.colourTransition(background, 'rgba(74, 164, 233, 1)', 0.4, 30)
else if scroll.currentPage.name is "card3"
module.colourTransition(background, 'rgba(0, 239, 239, 1)', 0.4, 30)

Daniel Lin

Brian V. Tran

Read the entire post on Facebook