Website embeds - play on scroll into view

Hi guys,

Are there any reliable & simple methods to trigger hype animations such as when a website button is triggered or a section scrolls into view. I am no JS / hype ninja, but I can copy and paste scripts very efficiently :laughing:. I am playing around with webflow hype embeds as a side project.

For showing a Hype animation when visible, you would use a Viewport Action:

The button example on this section is what you would want for triggering an action from outside of Hype:

<button type="button" onclick ="HYPE.documents['scenes-transitions'].showSceneNamed('Scene2',HYPE.documents['scenes-transitions'].kSceneTransitionPushRightToLeft);">
   Show Scene 2 (Push Right to Left)

The above code assumes you had a document embedded with the export name scenes-transitions.


Thanks @Daniel!. That all looks workable !

1 Like