- This topic has 9 replies, 2 voices, and was last updated 1 year ago by Leo.
December 18, 2019 at 3:45 am #1107598Samuel
I use the smooth-scroll option for anchor link and a sticky menu. When I put an anchor on accordion items it lands on body part of the accordion and title part is hidden by sticky menu, like shown in link.
I don’t know if it’s the normal behaviour or not, maybe it is, but if so is there anyway to add a margin-top or something to the landing of the anchor links ?
thanks !December 18, 2019 at 8:22 am #1107933LeoStaffCustomer Support
Can you confirm that you are using GP’s smooth scroll script?
If so it should account for the sticky navigation height by default.
Let me know 🙂December 18, 2019 at 8:26 am #1107940Samuel
As I said :
I use the smooth-scroll option for anchor link”
Did you check the link I gave to you ?
I don’t know what to add at what I explained, here it is again : I think anchor in this case is displayed in the body part of accordion, it would explain title is hidden by sticky menu, so I would need to add a margin-top or something similar to add space and be able to see accordion title.December 18, 2019 at 10:09 am #1108041LeoStaffCustomer SupportDecember 18, 2019 at 10:53 am #1108077Samuel
As seen here : https://www.screencast.com/t/S8JIcatuBJL
The anchor is on the DIV attribute, so it should display title shouldn’t it ?
According to you there is no way to set a margin-top to the anchor position landing ?December 18, 2019 at 11:26 am #1108112LeoStaffCustomer Support
Huh..for some reason I’m seeing different HTML comparing to what you are showing:
I’m not seeing the
smooth-scrollclass or the div ID.
It’s very hacky to use CSS for anchor position which is why we implemented automatically with the sticky navigation:
David provided a workaround/hacky solution here:
https://generatepress.com/forums/topic/jump-too-anchors-headings-covered-by-stick-navigation/#post-887821December 18, 2019 at 11:39 am #1108124Samuel
I found a solution that is working, I apply a class (e.g. “anchor”) to my accordion block and add this CSS :
Adjust as needed.
ThanksDecember 18, 2019 at 11:40 am #1108125LeoStaffCustomer SupportDecember 18, 2019 at 11:50 am #1108133Samuel
Just to finish about the smooth-scroll, I added the script in my function.php to apply smooth-scroll to every anchor links. So it’s normal you don’t see any class on my DIV or so. 😉December 18, 2019 at 11:52 am #1108135
- You must be logged in to reply to this topic.