1
0

new drop down menü

This commit is contained in:
Alexander 2024-01-02 21:09:38 +01:00
parent 0f34781928
commit fe58239332

View File

@ -113,6 +113,7 @@
text-align: center; text-align: center;
text-decoration: none; text-decoration: none;
display: block; display: block;
font-size: 250%;
} }
.mobile-menu { .mobile-menu {
@ -151,7 +152,7 @@
.mobile-menu.show { .mobile-menu.show {
display: block; /* Bei Klick auf das Symbol anzeigen */ display: block; /* Bei Klick auf das Symbol anzeigen */
background-color: red; background-color: rgb(104, 0, 0);
} }
.menu { .menu {
@ -212,27 +213,7 @@
menuLinks.classList.toggle('show'); menuLinks.classList.toggle('show');
mobileMenu.classList.toggle('show'); mobileMenu.classList.toggle('show');
if (mobileMenu.classList.contains('show')) {
body.style.backgroundColor = 'red';
} else {
body.style.backgroundColor = 'transparent';
} }
}
// Überwache Änderungen der Bildschirmgröße
window.addEventListener('resize', function () {
var screenWidth = window.innerWidth;
var mobileMenu = document.querySelector('.mobile-menu');
var body = document.body;
// Überprüfe, ob das mobile Menü sichtbar ist
if (mobileMenu.classList.contains('show')) {
body.style.backgroundColor = 'red';
} else {
body.style.backgroundColor = 'white';
}
});
</script> </script>
</body> </body>
</html> </html>