The file does not really matter, what you are looking for is a target, and gun. The target has to be something with an ID, as in an element ID, whether its text, object, picture. For example:
<img id="ScrollTop" src="" />
<a id="ScrollTop" href=""></a>
<div id="ScrollTop"></div>
So no matter what the target is, so long as its a ID.
The next is the gun, or trigger. You can use the same as above to fire the code. But in Hype, you don’t need too if you are going to trigger it from an element in Hype, and use JS. The code above is for triggering.
Is does not matter what code you use, but you would have too have an ID for each layout as a target, for example:
<img id="iPad_ScrollTop" src="" />
<a id="Desk_ScrollTop" href=""></a>
<div id="phone_ScrollTop"></div>
And the trigger for each layout would need to find the corresponding target. Hype loads all layouts out once, which is a shame, I would rather is looked at the screen size, and then loaded the layout required only. But due to this, you have to have ID’s that are unique.
Both cases, you have only copy and pasted the full code Daniel sent, which relies on the <a>
tag to fire. But again, you do not need that in Hype, because the onClick, onMouseUp, etc is done for you on all elements / objects.
Place this code, as it is in a function from a click event, in your apps case is would be the arrow image.
var target = $('#iPad_ScrollTop'); // ** Target Element
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top,
}, 1000);
}
** The element you want to show, give an ID and enter it as the target.
Then you can add easing to make it scroll with different effects. Hope that helps 