Skip to main content
Question

How to have TOC state change while scrolling on a page


I have a TOC at the top of the page. When I click on it I can scroll to the relevant section. But I also need the opposite: When I scroll the page of my prototype I also need the TOC state to change. How can I do that? Any tutorial anywhere?

Please Help 🥰

This topic has been closed for comments

3 replies

Vishal_Ramawat

Check this out


  • Author
  • 1 reply
  • June 14, 2024

@Vishal_Ramawat thanks a lot i need it for a prototype on mobile, so this solution won’t work. in my mind could be solved with variables. but not sure how.


Vishal_Ramawat

There’s an overkill. You can explore collision detection so when a frame reaches certain position trigger your interaction. Many people are creating games using such logic, like this.
But it will be like using a shotgun to kill a mosquito.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings