Streaming live at 10am (PST)

Fixed div respective to section - help

Hey all,

I’ve seen this question asked in a few times but I’m unable to make sense of the suggested approaches. Please advise;

Via; the public link

I would like my “Floating_nav” div to become fixed as it’s parent section reaches the top of the viewport. Thoughts?

Side question; As I go from section to section I would like to change the text in “Floating_nav” respective to the current section. Any thoughts on how I should approach that?

Thanks in adavance.

Here is my site Read-Only:
(how to share your site Read-Only link)

In my opinion (I never try this) - no way by webflow to create
sticky effect for selected parent container only for the entire page.

custom code

Anyway, it will take less than two minutes to move my codepen (Custom code) - to webflow:


anyone else have any other ideas?

No ideas. This is to much JS code (For now no way to change CSS (to fixed) by webflow interactions). rgalus sticky is a tiny library - why not use this?

wishlist Add / remove classes via Interactions

How to create sticky container on webflow by custom code (Less than a minute):

Start point -

  • Parent: section
    — Child: div

  1. custom code - Copy-paste before body:
<!-- 1/2. load sticky.min asset -->
<script src="" integrity="sha256-Bo3JGQq9V2eOtdGq6qYConGQtsVgey3GSlz5d03tK7M=" crossorigin="anonymous"></script><script>  var sticky = new Sticky('[data-sticky]', {});</script>
<!-- 2/2. instiliaze sticky-->
  var sticky = new Sticky('[data-sticky]', {});

  1. parent section. Add this attribute (webflow Custom attributes docs):
    name: data-sticky-container
    value: data-sticky-container

  2. Child div. Add this attribute:
    name: data-sticky
    value: data-sticky

  3. Publish. Done :slight_smile:


More options

Add more custom attributes the same way (For “child”) - like margin-top or sticky only on desktop and so on:

1 Like