Streaming live at 10am (PST)

Scroll down 120px when tap on the Button

Hello I just need help with Interaction on Scroll down button.
I just need to be able to scrolldown on the page for 120px when user will click on button.

Hi @petrbilek :wave:

I can’t think of a way to scroll specifically 120px using interactions, but you could use this bit of custom code which is supr easy to add.
Here’s how to add custom code to a specific page in your page settings

Make sure you give your button or element an ID of myButton in the settings panel.

Paste this to the page in the Inside <head> tag section:

<style>
html {
  scroll-behavior: smooth;
}
</style>

and paste the code below into the Before <body> tag section

<script>
let button = document.getElementById("myButton");

button.addEventListener("click", () => {
  window.scrollBy(0, 120); // <-- you can change this amount if you need more than 120px
});
</script>

This should then work on any button with that same ID. If you only want it to work on one button, then just give it a different ID (you can still use the same class)

Hope this helps, please ping me if you have any trouble. :smile:

Please note that this will only work on the published site, and not in preview mode

Ahh, thank you I’ll try it!

1 Like

It works smooth :slight_smile: thanks!

1 Like

tenor%20(15)

1 Like