I am wondering if someone can help me alter this code so that it resets or works with multiple elements?
On the website below I have this script set up to scroll right by 100vw Using the window.scrollBy(window.innerWidth /1, 0); when the purple box is hovered over.
however I would like it to work with multiple instances and can't seem to get it to work. Is anyone able to help me?
here is my script;
let button = document.getElementById("mybutton");
button.addEventListener("mouseover", () => {
window.scrollBy(window.innerWidth /1, 0);
});
and her is the url: https://ba-site-build.webflow.io/builds/dev-1-hover-slider.
i would really appreciate if anyone can offer any help so much!
Thankyou :)