Fixed header bug (Karuna)
-
Hi!
Just wanna report what I believe is a (tiny) bug in the Karuna theme.
It’s about
var stuckHeader = $( '.sticky-wrapper.sticking' );andvar stickyHeaderHeight = stuckHeader.outerHeight();in functions.js, really.On page load, there’s no
.stickingclass on the.sticky-wrapperdiv. As such,stickyHeaderHeightends up beingnull. (Can be seen writingstickyHeaderHeightto the console.)As a result, no
padding-topis added tobodyon scroll, and the page kind of ‘jumps up’. This is noticeable especially when the header image is not set. (Headings — or the page-wide header widget, if in use — will suddenly disappear behind the fixed header on scroll, making them a bit harder to read.)A quick fix would be to be to hard-code a (large enough) value (in px or ems) into the JavaScript file.
Another, and I believe cleaner (or at least less jerky in e.g. Firefox) fix I’ve used (at http://www.farma-service.be/, e.g.), is to assign
position: staticto the entire header (through an extra wrapper div) and a hard-coded offset tobody. (Upon scroll, the.sticky-wrapperdiv will sit ‘on top’ of the (now hidden) top-bar. No need to hide it or add padding tobody. You would still need to know the (almost) exact final sticking header height, though.
The topic ‘Fixed header bug (Karuna)’ is closed to new replies.
