How to create a scrolling section over a fixed section?

Hi!

I’m new to Figma & design - but trying to create an interaction on a prototype which involves two sections on one frame. One section would be fixed and is the top part of the frame, whilst the second section would allow me to scroll over the first section.

A reference of the same interaction can be found here on mobile view: [The Classic Check Cashmere Scarf in Mid Camel | Burberry® Official]

Sadly when I fix position when scrolling of the the top section of the frame, and set the second section to vertical scrolling it will scroll underneath the top section which is fixed on scroll.

Any help or advice would be greatly appreciated.

3 Likes

Have you found a solution for this?

When setting a layer to Fix Position When Scrolling, the layer will be above all other scrolling elements making any scrolling content appear beneath.

I created two variations on how you can get a result that might be more of what you’re looking for.

Here is a draft file you can see the difference:

1 Like

This is super helpful! Do you think the nested approach could be achieved with three cards?

@Phil_Larsen 's solution is super helpful, but what about use cases where you want there to be scrolling content both above and below a fixed element, without 2 different scrolling frames?

Modifying the order of fixed elements is easy enough via z-index and position:relative in code — I’m a little confused as to why Figma opted to set all the fixed layers forcefully at the top in the first place. Curious if there’s an existing feature request addressing this issue.

1 Like

This works if the “fixed” frame is just a plain color or image. But once you have buttons, text and anything else, when you toggle “fix position” it tends to be placed above everything else, so incoming frames from below when scrolling for example, those elements on the fixed frame shows in from of the incoming frame. I still can’t find solution for this one

1 Like

I’m joining the question. I don’t understand why fixed elements are forced to be above everything else. Doesn’t make any sense.

4 Likes

Hey guys, I’m from Taiwan. I think I find the way to resolve this issue.
In “Layer and Prototype Settings” video, you can check the relationships between all frames or other items.
In “Figma Prototype” video, yep! You’ll see the prototype that I made, and a shortcoming too :joy:
Hope it’s helpful. And forgiving me for my poor English :sweat_smile:

1 Like

Hi! Did you find a solution for this? I tried to do that but I didnt find any tutorial or solution

@Sannah_Siddique

It seems that you can do this now - Just set the layer to sticky, and it will stick based on the hierarchy the layer is in.

1 Like

Exactly. And scrolling over a plain background has the same effect as scrolling normally

Did you found the solution ??

i said did you find the solution

Just set the layer to sticky, and it will stick based on the hierarchy the layer is in. Put the layer in the section of the fixed layers and set the direction of the scroll. Worked for me.

I may have figured out a fix on this. I have no idea why it works because it doesn’t really make much sense and I accidentally stumbled upon it.

If you take the layer you want to scroll and move it above all other layers in the parent frame, it will say that it is “fixed”; however, if you look in the prototype bar, it will be labeled as “position: fixed, overflow: vertical”. This will allow the capability of having that layer scroll over fixed layers. You will have to play around with the exact placement of where it will scroll on the screen though by tweaking the frame vs the content within it, because that aspect of it really makes no sense to me either, but it works. Hope this helps.

2 Likes