Équivalent of HTML function "Named Anchor" in a Hype document

Hi all

I have no problem to navigate from a named anchor to another named anchor in a single HTML 5 file.

My problem here is that I want to do the same in a full Hype document. For example, an arrow at the bottom of a lenghty tocument to automatically reach the top of the same document.

Can I get some help here ? It would be so appreciated.

Thanks

Jean Robert Thibault

Bon Jour Jean!

Hype Demo: smoothScrolling_varJHSv1.hype.zip (59.8 KB)

This demo is based on this thread’s example (@Daniel who references @h_classen ) which has jQuery script dependencies (95K).

I have made some modifications to the file - some cosmetic & some functional. The functional changes involve controlling the speed of the scroll. The speed is set by two scripts - “scrollSpeedMedium” & “scrollSpeedInstant” both of which make a small change to the number in the script. This number represents milliseconds:
AA_CONFIG.animationLength = 500; (Medium)
AA_CONFIG.animationLength = 10; (Instant)

This code references the jQuery script: “jquery.arbitrary-anchor.js”

You can set the milliseconds to what You wish, though I find it can get a little jerky if the number is set to 1000 (i.e. 1 sec) or above.

=============================================

The “named anchor” mechanism works in two parts…

The button~trigger which references the target ID…
38%20AM

And the ID of the target (“named anchor”) which is set in the “Identity” panel as usual.
23%20AM

you also may have alook at @MaxZieb's extension

Far more lightweight - thanks for pointing this out & thanks @MaxZieb for all the work You have done on this “Extension” project.
Honking%20Horn%20right

Thanks to all of you. I will experiment your suggestions ans give a feedback if it works.

Greetings

JR Thibault

2 Likes

Thanks so much for your suggestion !

Thank you… although that code snippet linked above by @h_classen isn't an extension. Just a wrapper to the work from a talented woman on GitHub posted under the tag scrolling.


Also there is a native way (CSS) to do this now …

1 Like