Hi everyone,
I’m trying to slow down an animation that I created with JS. I’m currently using the “smooth” property for the “.scrollIntoView” function, the thing is that I want it to go slower than that. I think I could be possible to create a custom JS function to slow it down, but I’m not sure. My JS knowledge is pretty much null.
Thank you so much for the help in advance,
Pablo
<script>
// Auto scrool after 4 secs delay
const myTimeout = setTimeout(myAutoScroll, 4000);
function myAutoScroll() {
//with scrollTop we check if the page has been scrolled
//if == 0, it hasnt
if ($(window).scrollTop() == 0){
document.getElementById('scrollcard').scrollIntoView({behavior: "smooth"});
}
}
</script>
Here is my site Read-Only: [LINK]
Here is the published version to see the animation in action after 4 seconds (https://xl-animation-test.webflow.io/)