-
buatduit
Hi there,
I hope you’re well. I recently implemented a sticky sidebar for the Table of Contents on my website, but it’s not behaving as expected. Instead of staying fixed or floating as I scroll down the page, the sidebar scrolls away with the rest of the content.
Could you please help me figure out what might be causing this issue or guide me on how to fix it?
Thank you for your support!
Best Regards,
Buat Duit -
Alvind
Hi there,
Due to your layout structure, it’s not possible to make the section sticky. The parent container of a sticky element must have enough height for the sticky behavior to work properly.
The alternative would be to add the TOC into a sidebar and use custom CSS to achieve the sticky effect.
By the way, what method are you using to create the sticky TOC?
-
buatduit
Hi Alvind,
Thank you for your response.
I’ve managed to solve the initial issue by applying a suitable height to the parent container, which allowed the sticky behavior to work properly. To create the sticky TOC, I placed it inside a container and added custom CSS to achieve the desired sticky effect.
However, I’ve encountered a new issue: when viewing the page on a mobile device, the sticky TOC appears at the bottom of the article instead of remaining in view or behaving responsively.
Could you please advise how I can resolve this issue on mobile? I’d appreciate any guidance or best practices to make the TOC more mobile-friendly.
Thanks again for your help!
Best Regards,
Buat Duit -
Select the Grid container that contains the TOC, switch to mobile view, and set its
order
to-1
which will bring it up. -
buatduit
Hi there,
Thank you so much for your help!
I followed your instructions again, and this time the issue was successfully resolved. The TOC now appears correctly on mobile.
Really appreciate your support!
Best regards,
Buat Duit -
Glad to hear that 🙂
- You must be logged in to reply to this topic.