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

Calculated topSpacing #124

Open
Stibo opened this issue Jan 29, 2021 · 0 comments
Open

Calculated topSpacing #124

Stibo opened this issue Jan 29, 2021 · 0 comments

Comments

@Stibo
Copy link

Stibo commented Jan 29, 2021

We have a header element on our page that changes size if we scroll. If we scroll down it hides completely and if we scroll up, its getting visible again. That means we want two different topSpacing for our sticky sidebar. Close to the top border of the window (30px) if we scroll down and no header is visible. If we scroll up again, we want the sticky sidebar to move down the size of the header (100px), so that there are 30px between header and sidebar. The sidebar position should then be 130px instead of 30px if no header is visible.

We COULD do this easly with a custom function for topSpacing that calculates this positon but it seems like the position is only set if the affixed type changes. But the affixed type will of cource not change, because its still the same type, even though the position vaule has changed. Is there a way to get that calculated topSpacing working for our project?

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

1 participant