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

Offset position #28

Open
dpetrova opened this issue Nov 22, 2023 · 5 comments
Open

Offset position #28

dpetrova opened this issue Nov 22, 2023 · 5 comments

Comments

@dpetrova
Copy link

It would be nice if you add option for offset the fixed position.

@jd1378
Copy link
Owner

jd1378 commented Nov 22, 2023

hi
you can simply use another stuck class and replace top: 0 with your desired offset
https://github.com/jd1378/vue-sticky-element/blob/a1ae8fb853ef2c70791ae2e83c91546ba1399ebd/src/vue-sticky-element.vue#L343C10-L343C10

@jd1378
Copy link
Owner

jd1378 commented Nov 22, 2023

or maybe it's not that simple, cause I guess the sticking behavior needs to also include it in the logic

but why would you want an offset ?

@jd1378
Copy link
Owner

jd1378 commented Nov 22, 2023

if it needs to have a padding around it at all times, you can also wrap the whole navbar in another div and give it padding, which is simpler than updating the logic to include an offset

@dpetrova
Copy link
Author

My idea here is to stuck element to any arbitrary parent, not only to the top of the page

@jd1378
Copy link
Owner

jd1378 commented Nov 22, 2023

hmm, I see, I can imagine the use case, and it sounds interesting
I can't give a time frame as I'm very busy right now but I will definitely try to add this

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