I’m trying to figure out how to disable the scrolling reset that happens when clicking on a link to a scene from within a scrollable div. For clarity, here’s my setup (see corresponding image below):
- I have a vertical navigation area set up as a persistent symbol (A).
- (A) is not an HTML widget, just a stack of linked text links that’s considerably taller than the screen height. Because of this, it’s set to scroll.
- Each link is a rectangle that’s linked to a scene. Clicking on one transitions to the desired scene, with different content visible in the main area (B).
Everything works just fine, except for one thing: clicking on any of the links resets the scrolling nav panel to the top.
This isn’t a problem for any of them that are visible normally, but clicking on any that require scrolling down to reach makes them disappear when the scrolling is reset. I’m highlighting the currently selected item in the nav, which makes this pretty problematic.
I realize this is how anchored links always work, but can’t figure out how to override Hype’s built-in behavior.
I’ve looked into using
event.preventDefault() on the links, and tried some jQuery trickery, but nothing I’ve tried thus far has worked. I’m not exactly a seasoned expert with this stuff, so it’s likely I’m just doing something wrong. I’m pretty sure this would be relatively easy to resolve in a simpler non-Hype setup, but I’m at a loss here. Any help would be greatly appreciated!
Thanks in advance,