I have a page with a fixed navbar and when I set the link to go to a section on the page, the navbar overlays on top of the section and the top of the section sits at the browser top edge. Is there any way to make it so that the page scrolls so that the section top lines up with the bottom of the navbar?
If you go inside your header symbol, go to the section that has the âFixedNavBarâ class, and change itâs HTML5 tag to Header, it should work like you expect.
In case youâre interested in details, Webflow uses the following selector to find a header on your page for the smooth scroll script:
$('header, body > .header, body > .w-nav')
This means that Webflow will check to see if the following elements make up a fixed header:
An element with the header HTML5 tag type
An element with the class header directly inside the body
A navbar (has the w-nav class) directly inside the body
But I am having another issue thatâs been going on for a while. The smooth scroll does not work so smoothly in Safari 6 or 7. It looks okay in Chrome. I took a video of what I am seeing and its not only me, my client sees the same thing and it is not making webflow look very good as a design tool right now unless it gets fixed.
Safari does have known scroll performance issues that are outside of our control, but you can safely fall back to default browser behavior (instant, non-smooth scroll) if by adding a custom attribute to the main element:
Name: data-scroll-time
Value: 0
This will make sure that the default browser behavior is used, and will instantly scroll to the section. The one advantage over the native âjump to named elementâ is that it will account for the fixed header.
Iâm going to do a bit more investigation though to see if thereâs some way around Safariâs slowness.
The second attempt is better in my opinion. Simply add a bluebg class to that navigation bar and apply styles (background, box-shadow etc). Then remove that style so itâs not visible on default. To the regular navbar class simply add a transition effect so it will smoothly add that class to your navigation once you reach the bottom of the hero section Works perfectly for me on all browsers including Safari.
Hey Vlad, this doesnât seem to work with interactions on the navbar element when its set to show after the hero. I was hoping there might be a fix for this.
Here is my public link. The products link takes you to a section in the page.