You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
626 B
JavaScript

window.onload = () => {
const buttons = document.querySelectorAll(".multi-button button");
buttons.forEach((button, index) => {
button.addEventListener("mouseover", () => {
if (index > 0) {
const prevTooltip = buttons[index - 1].querySelector("div");
prevTooltip.classList.remove("animate-right");
prevTooltip.classList.add("animate-left");
}
if (index < buttons.length - 1) {
const nextTooltip = buttons[index + 1].querySelector("div");
nextTooltip.classList.remove("animate-left");
nextTooltip.classList.add("animate-right");
}
});
});
};