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

unstick not called if element is origianlly flush with top of page #110

Closed
mkstix6 opened this issue Jun 24, 2015 · 5 comments · May be fixed by #117
Closed

unstick not called if element is origianlly flush with top of page #110

mkstix6 opened this issue Jun 24, 2015 · 5 comments · May be fixed by #117

Comments

@mkstix6
Copy link

mkstix6 commented Jun 24, 2015

I have my menu bar that is the first element within the body and flush with the top of the viewport.
Scrolling down the page activates the sticky
But scrolling back up to the top does not unstick the element.

Usually this wouldn't be a problem as the element is exactly where it would be (except fixed) but i have some other behaviour that relies on the unstick element to change the position and size of other elements.

I can hack fix the issue by giving the body a 1px top margin.

Note: Safari's elastic scrolling strangely fixes the issue. I would wager because Safari can report scroll values in the negative.

@mjcampagna
Copy link

I'm also seeing this issue. I would love to see this debugged in the script, rather than having to hack around it in the design.

@mkstix6
Copy link
Author

mkstix6 commented Jul 13, 2015

So far my simple fix is to move it 1px from the top of the screen and mask the gap with box shadow. This then triggers normal behaviour. Depends on design though #accidentalflatdesignwin. Is your solution similar?

@lkraav
Copy link

lkraav commented Dec 28, 2015

#117 confirmed works. Such a simple patch. @leafo is there a known downside to it?

@gpoole
Copy link

gpoole commented Feb 29, 2016

@leafo could you please merge #117?

@tcharlss
Copy link

tcharlss commented Feb 6, 2018

Same problem, #117 fixes it for me.

@mkstix6 mkstix6 closed this as completed Oct 9, 2023
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

Successfully merging a pull request may close this issue.

5 participants