I'm not sure what you mean by a 'soft' scroll. Seeing an example would be great, as well as pointing out what you're expecting to see.
If you're linking to anchors and you want to ensure that anchor links scroll smoothly, you would use something like the second technique listed here: Scroll smoothly to the bottom of the page - #6
Thank you for your answers but it does not work. I had already tested.
What I do not understand is that if I use link “#etage” on a text html outside the animation, it works. But if I use this same link in a Hype animation, it does not work.
For the Smooth scroll function I use the Wordpress plugin "Page scroll to ID"but I have already tested 3 other plugins.
I hope I will find a solution, otherwise, I really have to give up my animation.
It looks like they are potentially hooking into <a> link elements instead of listening to window.location change events which is why using go to URL with the #etage anchor isn’t working. There’s probably two options:
Use the inner HTML of the element in Hype and create a <a href = "#etage">web</a> tag. This may not work depending on their hook construction.
Call their API directly with a Run JavaScript action. From reading their docs, it looks like the code would be:
It would not be trigger custom behavior. You'd just take an element, and choose Edit > Edit Element's Inner HTML and then add that text and see if it works. (But like I said, there's a good chance this won't).
It may be that you have an error here, the spacing is kind of weird. I'd try the exact line that I posted above, especially since the anchor tag seems to be #etage. That said I don't have a setup to try this, so it is only speculation! There are definitely other libraries folks have used for smooth scrolling; here's the previously link but I'd guess there are other solutions.
offsetTop
get the elements top in relation to the parents top.
The offsetTop returns a string '500px' instead of number 500
So we surround the call in a parseInt()
The parseInt() function parses a string argument and returns an integer of the specified radix (the base in mathematical numeral systems).
Thank you very much for these explanations and the time spent to find a solution, it is complex but it works !!!
I hope that the next version of Hype will improve the compatibility with Wordpress, the smooth scroll function is basic in an animation or a website.
On my side, this small function changes the whole approach that I can have of a web project on Wordpress and the use of Hype.
And I also thank the developers of Tumult for the Wordpress plugin “Tumult Hype Animations” which saves a lot of time to load animations in .OAM format.