Streaming live at 10am (PST)

Center a section issue


#1

I found a few forums that were closed but I am still having an issue.

This is the workaround that was suggested

Hey @matthew1818, I just added a way to enable this, but it requires you to configure it a bit manually. For any section that you want to scroll into view in the middle of the view port, add a new custom attribute called data-scroll and set its value to mid . Here’s how you do it:

  1. Select the element that you are scrolling to (not the link that triggers the scroll), go to the Settings tab, and click on + to add a new custom attribute:
  2. Set attribute details and press ‘Save’:

Once you do that (for each section that you want to have this behavior), Webflow should automatically scroll so that this element is in the middle of the page (even on page load if you have a URL to that specific part of the page). You’ll need to refresh your designer for this to work in preview mode, and republish your page for it to work externally.

Enjoy, and let me know if you find any bugs! :smiley:

But here is the issue another person had that didn’t really have an answer on how to deal with this situation.

Hi, I have a problem, when I set a link to scroll to a section, even with the ‘data-scroll=mid’ attribute, the section takes the navbar into account and moves the section slightly down to fit the navbar, even if the navbar is set to display none?

and in my case, I have an interaction set so that when I scroll down the absolute positioned nav bar will move up and out of the way. But when the section tries to center it is also slightly down to fit the navbar which has moved up and out of view…

Not sure how to deal with this and it would be great to get some advice.

Thanks,


Here is my site Read-Only: https://preview.webflow.com/preview/radiancevt?utm_source=radiancevt&preview=fb2a2368736e8099c8978f056c6093c1


#2

Add the nav to z-index really high. And have the section’s z-index lower. It should scroll under it.