Skip to content

Commit

Permalink
js script update
Browse files Browse the repository at this point in the history
  • Loading branch information
JoaquinSuarezVallejos committed Apr 22, 2024
1 parent 9e4c63d commit 1315738
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,32 +51,32 @@ contactBtn.onclick = function() {
window.scrollTo(0, document.documentElement.scrollHeight);
}

// Menú de Navegación para Mobile (Side Navigation for Mobile)
let body = document.querySelector("body");
let navBar = document.querySelector(".navbar");
let menuBtn = document.querySelector(".menu-btn");
let cancelBtn = document.querySelector(".cancel-btn");
menuBtn.onclick = function() {
navBar.classList.add("active");
menuBtn.style.opacity = "0";
menuBtn.style.pointerEvents = "none";
body.style.overflow = "hidden";
scrollBtn.style.pointerEvents = "none";
}
cancelBtn.onclick = function() {
navBar.classList.remove("active");
menuBtn.style.opacity = "1";
menuBtn.style.pointerEvents = "auto";
body.style.overflow = "auto";
scrollBtn.style.pointerEvents = "auto";
}
// // Menú de Navegación para Mobile (Side Navigation for Mobile)
// let body = document.querySelector("body");
// let navBar = document.querySelector(".navbar");
// let menuBtn = document.querySelector(".menu-btn");
// let cancelBtn = document.querySelector(".cancel-btn");
// menuBtn.onclick = function() {
// navBar.classList.add("active");
// menuBtn.style.opacity = "0";
// menuBtn.style.pointerEvents = "none";
// body.style.overflow = "hidden";
// scrollBtn.style.pointerEvents = "none";
// }
// cancelBtn.onclick = function() {
// navBar.classList.remove("active");
// menuBtn.style.opacity = "1";
// menuBtn.style.pointerEvents = "auto";
// body.style.overflow = "auto";
// scrollBtn.style.pointerEvents = "auto";
// }

// Barra de Desplazamiento Lateral inactiva cuando clickeamos en links de navegación
let navLinks = document.querySelectorAll(".menu li a");
for (var i = 0; i < navLinks.length; i++) {
navLinks[i].addEventListener("click" , function() {
navBar.classList.remove("active");
menuBtn.style.opacity = "1";
menuBtn.style.pointerEvents = "auto";
});
}
// // Barra de Desplazamiento Lateral inactiva cuando clickeamos en links de navegación
// let navLinks = document.querySelectorAll(".menu li a");
// for (var i = 0; i < navLinks.length; i++) {
// navLinks[i].addEventListener("click" , function() {
// navBar.classList.remove("active");
// menuBtn.style.opacity = "1";
// menuBtn.style.pointerEvents = "auto";
// });
// }

0 comments on commit 1315738

Please sign in to comment.