Remove shadow and disable hovering on mobile view

This commit is contained in:
klmp200 committed 2025-06-05 17:49:47 +02:00
1 parent 7090254658
commit 64fd123a85
2 files changed
+13 -3

No files matched your search

+9 -2
View File
@@ -123,12 +123,19 @@
{% block script %}
<script>
const menuItems = document.querySelectorAll(".navbar details[name='navbar'].menu");
const isMobile = () => {
return window.innerWidth >= 500;
}
for (const item of menuItems){
item.addEventListener("mouseover", () => {
item.setAttribute("open", "");
if (isMobile()){
item.setAttribute("open", "");
}
})
item.addEventListener("mouseout", () => {
item.removeAttribute("open");
if (isMobile()){
item.removeAttribute("open");
}
})
}