-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[Sticky / Visibility] Fixed Isn't Removed Until Top Offset is Surpassed by 1px #2777
Comments
This is an edge condition of sticky. Fixed isnt removed until it surpases its previous position not equals it. Since the content is exactly at I'll look into seeing whether it messes up anything if we swap If you need content that replaces itself with a placeholder, you should try using visibility. I should probably make a note of that in docs. |
This fix still doesn't work great... The content appears to jump after 1px is surpassed and vice versa when you reach the top. EDIT: Ignore my comment. Second jsfiddle fix managed to fix the glitching. |
Yeah visibility handles placeholder case, sticky does not (generally used for adjacent content) |
Hello,
I have a sticky header, residing above my page content.
It's all set up according to http://semantic-ui.com/modules/sticky.html.
(see Fiddle link below)
Scrolling down the page works fine: The header stays at the top of page, whereas the content scrolls below.
But when scrolling back top, the top of the page content gets stuck just below the header, which overlaps the page content.
I examined this using dev tools and saw that when scrolling down, Semantic UI adds classes "fixed" and "top" to the sticky header, which don't get removed when page is scrolled back to top again.
Meanwhile, as a workaround, I implemented an own handler, which detects the page is scrolled to top again and removes the classes manually.
Here is a JS Fiddle, to demonstrate the issue:
http://jsfiddle.net/Windwalker/vmk41s9j/2/
Can you tell whether this is a bug which will be fixed?
Or is there something I can to to avoid this behaviour beforehand?
Kind regards,
Sascha.
The text was updated successfully, but these errors were encountered: