Complex navigation bar interaction

Hi there — I’m trying to mirror the navigation action of this Unity page:

I am trying to:

  1. Make the nav stick after scrolling a certain amount (I have accomplished this)
  2. The ability to click on a dropdown within the nav, and have the page stay anchored at the point at which the user clicked on the dropdown.
  3. The ability to collapse the same dropdown + continue scrolling

I have tried to build this through clicking actions, but the other elements on the page begin animating as the pages switch between one another. Is there a way to accomplish this interaction without switching pages altogether?