Scroll to top in a frame

I have created a frame (group) with [Content Overflow] scrollbars.
So the content of this box can scroll up and down.
When you are at the very bottom of this frame I want to return to the top with a button (with a Mouse Click, Actions).
How can I do that?

1 Like

The basic steps would be:

  1. Give your scrollable group a Unique Element ID in the Identity Inspector (for example, "mygroup")

  2. Run JavaScript for your on click action that looks like:

    hypeDocument.getElementById("mygroup").scrollTop = 0;
    

Thank you Jonathan! That was very useful! I am only now aware of the usefulness of working with IDs. That's why most of the Javascripts didn't work.

1 Like

Yup, IDs or Class Names (generally if you have multiple items you want to target or work in a symbol or multiple layouts) are the key way to bind something in Hype to code.

I do this simply with a clickable that go to the URL's name

Example. go "index.html". It will reload the page giving the impression it has moved to the top.

JR Thibault

1 Like