Skip to main content
Question

How to have TOC state change while scrolling on a page

  • June 12, 2024
  • 3 replies
  • 263 views

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 replies.

3 replies

Vishal_Ramawat

Check this out


  • Author
  • 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.