Scrolling to change scene

I have looked through the various threads on here about scrolling but couldn’t find anything about scroll to change a scene - so I figured I’d start my own. Basically when the user scrolls down on a scene, I’d like to jump to another scene with a transition, then when they scroll back up again they would go to the previous scene.

Has anyone got any ideas on how to go about this?


1 Like

In the Scene panel of the Inspector, configure the Swipe Up/Down events with Jump to Scene actions for your next (or previous) scenes.

I thought of that but when I tried it didn’t work with scrolling. If you are on a computer you physically have to click and drag for it to be a swipe event. I just want to let them change scene if they scroll i.e. on a mouse wheel. Is this possible? Thanks

If you are using jQuery, you could use its $( “#xxx” ).scroll(); event to trigger Hype’s hypeDocument.showNextScene(optionalTransition, optionalDuration) or hypeDocument.showPreviousScene(optionalTransition, optionalDuration) methods.

For this to work, you would need to establish a way of distinguishing scroll up from scroll down.

Yes I have figured out a way now see this post:

I just need to prevent downward scroll on one of the scenes without disabling the upward scroll…

Have you looked at wheelDelta and event properties to determine amount and direction of scroll?

I have had a look but am by no means very skilled with javascript and especially jQuery.

Place a null object (small and transparent) at the bottom of the scrolling scene. Assign it an Enter Viewport > jump to scene action. When the object moves into view, the jump happens.