Element that follows scrolling

Hi everyone,

I would like to have a element on my side which should follow downward while scrolling.
Here is a screenshot for demonstration what I mean:

This element should funktion as an additional side menu bar on one side.
How can I make it work :D?

There’s a sweet little Javascript for that here:

Thanks :slight_smile: In the info is written “You need to call the ScrollWithMe class in your JavaScript” and since I don’t have any coding skills how can I make it work? What are exactly the steps?

Not sure if this helps.

Infinity scrolling is a different thing KB.

You can do this without JavaScript a couple of ways depending on the design. With position tools in the class editor.

Approach very much depends on layout and if you want it to apply only when the menu scroll to the top of the page. Eg. .sticky-top but you also need to resolve any overflow styles applied to parent elements. Or it breaks.

The easiest is fixed position. Although you also need to consider how this looks (padding/margins for content etc) and user interaction on mobile.

1 Like

This sounds all very good but I still have no idea how it’s all done.
I’m new to Blocs.

Thank for clarifying. Infinity Scrolling is pretty cool!

Can someone help me out make this ScrollWithMe script work. I have no idea about javascript :frowning:

It’s still a bit rough but it works sweet. :slightly_smiling_face:

Kapture 2022-09-21 at 19.42.13