-
-
Notifications
You must be signed in to change notification settings - Fork 185
Open
Description
Issue:
While a menutoggle() function exists in main.js, it relies on a hardcoded maxHeight that might not accommodate future menu items, and the responsive styling in style.css is minimal.
File to edit: Ecommerce-Website/main.js
Change: Update the menutoggle function to dynamically calculate height or use a class toggle for better flexibility.
Code Addition:
function menutoggle() {
const menu = document.getElementById("menu-items");
// Toggle a class instead of manual height for better CSS control
menu.classList.toggle("show-menu");
// Alternative dynamic height logic
if (menu.style.maxHeight === "0px" || menu.style.maxHeight === "") {
menu.style.maxHeight = menu.scrollHeight + "px";
} else {
menu.style.maxHeight = "0px";
}
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels