Skip to content

done #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 19, 2023
Merged

done #60

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 0 additions & 72 deletions intro-section-with-dropdown-navigation-main/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,78 +4,6 @@
const openMenu = document.querySelector(".menu-open-icon");
const closeMenu = document.querySelector(".menu-close-icon");
const navBar = document.querySelector("nav");
const dropDownContainers = document.querySelectorAll("header nav ul li a");
const dropDowns = document.querySelectorAll("header nav ul li ul");
const dropdownArrows = document.querySelectorAll(".changeImg");




// // Handles the dropdowns
// dropDownContainers.forEach((dropDownContainer, index) => {
// // Function to close all dropdowns and open the selected one
// const toggleDropdown = () => {
// dropDowns.forEach((dropdown, i) => {
// if (i !== index) {
// dropdown.classList.add("drop");
// dropdownArrows[i].src = "./images/icon-arrow-down.svg";
// }
// });

// dropDowns[index].classList.toggle("drop");

// if (dropDowns[index].classList.contains("drop")) {
// dropdownArrows[index].src = "./images/icon-arrow-down.svg";
// } else {
// dropdownArrows[index].src = "./images/icon-arrow-up.svg";
// }
// };

// // Toggle on mouse enter
// dropDownContainer.addEventListener("mouseenter", toggleDropdown);

// // Toggle on focus
// dropDownContainer.addEventListener("focus", toggleDropdown);

// // Toggle on mouse leave
// dropDownContainer.addEventListener("mouseleave", () => {
// if (!dropDownContainer.matches(":focus")) {
// toggleDropdown();
// }
// });

// // Toggle on blur
// dropDownContainer.addEventListener("blur", () => {
// if (!dropDownContainer.matches(":hover")) {
// toggleDropdown();
// }
// });


// // dropDownContainer.addEventListener("mouseenter", () => {
// // // Toggle the 'drop' class on mouse enter
// // dropDowns[index].classList.toggle("drop");

// // // Change the dropdown arrow image on mouse enter
// // if (dropDowns[index].classList.contains("drop")) {
// // dropdownArrows[index].src = "./images/icon-arrow-down.svg";
// // } else {
// // dropdownArrows[index].src = "./images/icon-arrow-up.svg";
// // }
// // });

// // dropDownContainer.addEventListener("mouseleave", () => {
// // // Toggle the 'drop' class on mouse leave
// // dropDowns[index].classList.toggle("drop");

// // // Change the dropdown arrow image back to the original on mouse leave
// // if (dropDowns[index].classList.contains("drop")) {
// // dropdownArrows[index].src = "./images/icon-arrow-down.svg";
// // } else {
// // dropdownArrows[index].src = "./images/icon-arrow-up.svg";
// // }
// });


// Handles the handburger menus and the navbar
openMenu.addEventListener("click", () => {
Expand Down