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

What is Framer? Join the Community
Return to index
Mudit Mittal
Posted Aug 11 - Read on Facebook

Hi all, I'm trying to prototype a horizontal scrolling list of several cards which begins by default on the second to the last card. So the content list needs to be scrollable in both left and right directions. I can't get the list to scroll to the right, on scroll end it anchors back to starting point. I know this should be easy, but I can't seem to figure it out. Can someone help please?


Arron J Hunt

Can you share your code?
Are you trying to have a simple LTR scrolling view or are you using a PageController?

Mudit Mittal

I'm not using a PageController. I found a solution that works for now, not sure if this is ideal or not.

Mudit Mittal

cards =
cards.x = 0

# Cards scroll
scroll = ScrollComponent.wrap(cards)
scroll.contentInset = { right: 60, left: 60 }
scroll.scrollVertical = false
scroll.scrollX = 1225

Mudit Mittal

Basically I wrap the cards in scrollable view and then move the default view manually to the position I want. For static number of cards this solution will work, but if I try to generated cards dynamically, it will become very complex I think.

Mudit Mittal

The reason I did not use PageComponent is because in my case the sleeve of previous and next cards are visible on each screen, and it was a nightmare trying to get content from next page to be visible on 'this' page. I'm open to suggestions if you think I'm doing something wrong

Cemre Güngör

I've seen examples on the examples page where pagecontrollers show the edges of the previous and next pages - I'd browse that

Mudit Mittal

Cemre Güngör, can you pls share url if you remember which example. Thanks in advance.

Mudit Mittal

Got it! Thanks, I had overlooked this one for some reason earlier.

Read the entire post on Facebook