Browser: Firefox 40 in Linux
Steps to reproduce:
1. Have a page with a sticky nav, a header above it, and enough content below it to scroll down the page.
2. Scroll down the page, enough that the nav is stickied.
3. Refresh the page.
4. Scroll to the top of the page.
Expected: The page looks normal.
Actual: The page has extra space at the top, the size of the nav.
Notes: Using non-responsive fixed-width Zen 3 theme. Modification to the default: #header is a sibling to #navigation in the DOM. The stickied element is a subnode of #navigation.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | stickynav-2574207-12.patch | 625 bytes | jelle_s |
Comments
Comment #2
nvidian commentedSame issue with me using Adaptive theme (sub theme).
It may be fix (temporary) with CSS:
Comment #3
erykolryko commentedThank you you saved me hours and days of searching
#2 worked for me
Comment #4
buttonwillowsix commented#2 also worked for me with a Bootstrap theme. Thanks! But... it introduces a weird behavior where the first anchor that is clicked is over-shot (the scrolling scrolls right past the anchor) JUST on the first click. After that it behaves well. Anyone have any ideas?
Comment #5
a65162 commentedIn this module, It set originalPadding variable to remember original body padding-top, but If you don't regularly see the page, It'll get incorrect value.
Comment #11
hockey2112 commented#2 worked for me. Thanks!
Comment #12
jelle_sThis patch fixes it for me.
Comment #13
Manuel Ferreira commentedIn in Drupal 8.5 Theme Bartik and using the Sticky Navigation 8.x-1.1.
And the issue remains...
Solved via
So far my solution was to apply CSS + jQuery to me theme:
CSS
body.js--padding-fix {
padding-top:0 !important;
}
and JQUERY
jQuery(document).ready(function () {
if (jQuery('div.primary-menu-container-global').hasClass('stickynav-active'))
{
jQuery('body').addClass('js--padding-fix');
}
});
Note: if you apply the CSS directly to the body tag. as suggested before, it creates a problem with the Admin Menu, that covers the top of the site (minimized this way)
Is there a better solution?
Comment #14
johnnny83 commentedI have the same problem with the body padding-top. It also occurs if you scroll down, click a link and use the back button of the Browser to come back.
Comment #15
nwom commented#12 works great. Thank you!
Comment #17
mattbloomfield commented