Archived topic
Back to top scroll behaviour
7 replies · Started by Matthias on February 8, 2020
I would like to change the scroll back to top behaviour. I have found this code:
add_filter( 'generate_back_to_top_scroll_speed', 'tu_back_to_top_scroll_speed' );
function tu_back_to_top_scroll_speed() {
return 400; // milliseconds
}
How can I add "ease-in ease-out" behaviour to the scroll?
Hi there,
That's not currently possible unfortunately.
You would need to find a custom script.
Okay, that is disappointing! So how can I add a class to the "back-to-top-button" or links?
Thanks for the link. The guy has the same problem and had also the same idea like me. I also use the ps2id plugin to smoothly scroll to links with #-tags. Maybe there is a way to delete the click event (event listener) from the button? I think the click function overrides the ps2id‘s function. As the problem seems to be quite common (although I did not find it in your forum), do you think that there is a way out of this issue? I mean, you are the tec-guys with programming skills. It would be nice to get a solution for this.
Thanks and best regards
Just want to make sure you know that we have built-in smooth scroll script but that doesn't work for you?
https://docs.generatepress.com/article/smooth-scroll/
Let me know :)
Is it possible to give the button an new href like "#masthead" and additionally is it possible to disable the click event so that ps2id can handle this event?
Hi there,
Our back to top button wasn't really built use a custom click event, but it's not a bad idea to implement in the future.
You'd need to build your own custom back to top button script/HTML/CSS in order to assign a different click event to it.