Hi guys, I want to hover the dropdown menu. But when I do it using the following code, it doesn’t allow it when going from the first option to the second option. Dropdown menu is closing, you can test it on the site.
I was using this code below:
<script>
let items = document.querySelector(".header__inline-menu").querySelectorAll("details");
console.log(items)
items.forEach(item => {
item.addEventListener("mouseover", () => {
item.setAttribute("open", true);
item.querySelector("ul").addEventListener("mouseleave", () => {
item.removeAttribute("open");
});
item.addEventListener("mouseleave", () => {
item.removeAttribute("open");
});
});
});
</script>
My website: https://juweliermarkt24.ch/