I'm currently developing a WordPress website with Elementor Pro. My client is asking for up and down buttons to navigate the homepage.
I placed this javascript code to a HTML widget:
<script>
const changeView = (index) => {
window.scrollTo({ top: window.scrollY + window.innerHeight * index, behavior: 'smooth' });
}
</script>
<button id="button-up" onclick="changeView(-1)">UP</button>
<button id="button-down" onclick="changeView(1)">DOWN</button>
I couldn't make it work with Scroll Snap function in Elementor. If Scroll Snap is enabled, the buttons don't work. Can you help me to fix it?
Thanks!