Broken Offset with sticky header
-
I have to excuse myself, because i have already emailed you via contact form some days ago.
I think, it could be an interesting topic for all users and we don’t have a totally private conversation.
I have created this page https://coaching-impulswerk.de for a friend of mine.I use a landing Desktop header and another sticky Desktop header for scrolling.
The main menu uses anchor links. I’ve corrected the Desktop offset by (latest version):
h2::before {
display: block;
content: ” “;
margin-top: -125px;
height: 125px;
visibility: hidden;
pointer-events: none;—–
Ive also tried:
a[ID]:before {
content:””;
display:block;
height:90px;
margin:0px 0 0;and a lot more.
These Desktop menus are working, but the CSS is not working for the mobile menu.
I’m pretty sure, all CSS is ignored and if not ignored, the mobile menu breaks (non clickable links e. g.).
So not to break my links completely, I have created 2 menus with different h2/anchor ids (desktop with h2 CSS vs mobile ids by possible anchor/a CSS.
Sidenote:
There is also an interesting bug if i use the actual h2 CSS solution with the mobile menu. On Chrome, offset is not working but I have an orange frame around the landing spot. The orange color is only used by the mobile admin menu.Mobile menu: I think the offset is only calculated by the formula within mobmenu.js. And I don’t get it right. It seems to be either this calculation part will be ignored completely or the headerlength is misinterpreted.
Actually the offset seems to be around 300px or more estimated by latest Chrome.
There isn’t any option for manually changing the value within the admin panel.
I’ve tried to edit the mobmenu.js to no avail. Most probably i havn’t found the correct solution. Btw. the js is vanilla again.How can i land at the exact spot with anchor links on mobile menu and not breaking my other menus?
The page I need help with: [log in to see the link]
- The topic ‘Broken Offset with sticky header’ is closed to new replies.