Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dealing with a Fixed Navbar #1130

Open
dliebner opened this issue Dec 8, 2022 · 2 comments
Open

Dealing with a Fixed Navbar #1130

dliebner opened this issue Dec 8, 2022 · 2 comments

Comments

@dliebner
Copy link

dliebner commented Dec 8, 2022

Let's say we've got a fixed navbar at 60px height. Is there an easy way to pass in / factor in that 60px offset for scroll position calculations? For example, if we try to scroll to the top of an element, with a fixed navbar at the top of the screen, the top part of the element will be covered the navbar.

@oneyoung19
Copy link

I met the same issue,and i didn't find how to settle it in V2.

@oneyoung19
Copy link

oneyoung19 commented Jan 16, 2024

OK. I have found this way. We can set scroll-margin-top: 60px in style. This is a new feature in #1197 .But it didn't be written into README yet. It worked on scroll-into-view-if-needed@^3.1.0 or smooth-scroll-into-view-if-needed@^2.0.2 by my test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants