✔ Page - Anchor Scrolling offset - Because of the sticky header there needs to be a scrolling offset.
Completed by Ryan R.
- Assigned to
-
Ryan R.
- Notes
-
https://cotlf.diocesanweb.org/sacraments/weddings/#preparation-guide
I was impressed how I figured out the "Double anchors" for the page, but it would work better with a scroll offset. I know has done it for a couple sites and so has KB. but the code basically is this but the 50 px is changed to whatever the masthead height is, which in this case is 114px. May be better answers here, but this seems to work.
Sam
#anchor { padding-top: 50px; margin-top: -50px; }
I had penciled in the offset when I tackle the smooth scrolling on anchors to-do. Doing it with jquery/javascript will make it future proof.
jQuery UI Tabs isn't playing friendly when attempting to combine smooth scroll and offset. Continuing to work this problem out.
LSS short, there were several different things happening all at once, so I kinda had to peel it apart to get it sorted out. On page load, on tab load, on focus, etc.
ShiftNav was actually the biggest issue, as it and UberMenu have a scroll offset. I think it was applying some scrollto rules as part of the plugin. I went down a path where I wound up deactiving ShiftNav and reactivating it, and magically my last bug with the tabs/anchors/scroll/offset vanished.
So the scroll amount will be the same [currently] if you clicked the second one, or the 5th one.
With more effort, yes would could fine tune it to get more precise. I was just happy to get something that actually worked, and figured that was probably good enough.