Hi @Ava ,
This is possible by selecting the Javascript action (only premium)
and using the following code:
/*
* Source: https://github.com/Robbendebiene/Sliding-Scroll/
* y: the y coordinate to scroll, 0 = top
* duration: scroll duration in milliseconds; default is 0 (no transition)
* element: the html element that should be scrolled ; default is the main scrolling element
*/
const scrollToY = (
y,
duration = 0,
element = document.scrollingElement
) => {
// cancel if already on target position
if (element.scrollTop === y) return;
const cosParameter = (element.scrollTop - y) / 2;
let scrollCount = 0,
oldTimestamp = null;
function step(newTimestamp) {
if (oldTimestamp !== null) {
// if duration is 0 scrollCount will be Infinity
scrollCount += (Math.PI * (newTimestamp - oldTimestamp)) / duration;
if (scrollCount >= Math.PI) return (element.scrollTop = y);
element.scrollTop =
cosParameter + y + cosParameter * Math.cos(scrollCount);
}
oldTimestamp = newTimestamp;
window.requestAnimationFrame(step);
}
window.requestAnimationFrame(step);
}
scrollToY(
1500, //px
1000 //ms
);