epic
epic
KPCKevin Powell - Community
Created by epic on 9/29/2023 in #front-end
responsive mobile button isnt working
solved now
49 replies
KPCKevin Powell - Community
Created by epic on 9/29/2023 in #front-end
responsive mobile button isnt working
alr
49 replies
KPCKevin Powell - Community
Created by epic on 9/29/2023 in #front-end
responsive mobile button isnt working
DEFER FIXED YESSSSSSSSSS
49 replies
KPCKevin Powell - Community
Created by epic on 9/29/2023 in #front-end
responsive mobile button isnt working
it
49 replies
KPCKevin Powell - Community
Created by epic on 9/29/2023 in #front-end
responsive mobile button isnt working
fixed
49 replies
KPCKevin Powell - Community
Created by epic on 9/29/2023 in #front-end
responsive mobile button isnt working
like this
49 replies
KPCKevin Powell - Community
Created by epic on 9/29/2023 in #front-end
responsive mobile button isnt working
const primaryNav = document.querySelector(".primary-nav");
const navToggle = document.querySelector(".mobile-nav-toggle");

navToggle.addEventListener('click', () => {
const visibility = primaryNav.getAttribute("data-visible")

console.log(visibility)
if (visibility === "false") {
primaryNav.setAttribute('data-visible', true)
navToggle.setAttribute('aria-expanded', true)
} else {
primaryNav.setAttribute('data-visible', false)
navToggle.setAttribute('aria-expanded', false)
}
});

defer
const primaryNav = document.querySelector(".primary-nav");
const navToggle = document.querySelector(".mobile-nav-toggle");

navToggle.addEventListener('click', () => {
const visibility = primaryNav.getAttribute("data-visible")

console.log(visibility)
if (visibility === "false") {
primaryNav.setAttribute('data-visible', true)
navToggle.setAttribute('aria-expanded', true)
} else {
primaryNav.setAttribute('data-visible', false)
navToggle.setAttribute('aria-expanded', false)
}
});

defer
49 replies
KPCKevin Powell - Community
Created by epic on 9/29/2023 in #front-end
responsive mobile button isnt working
49 replies
KPCKevin Powell - Community
Created by epic on 9/29/2023 in #front-end
responsive mobile button isnt working
new.js:4 Uncaught TypeError: Cannot read properties of null (reading 'addEventListener') at new.js:4:11
49 replies
KPCKevin Powell - Community
Created by epic on 9/29/2023 in #front-end
responsive mobile button isnt working
so my code works in JS fiddle but now im getting a error on the actual website
49 replies
KPCKevin Powell - Community
Created by epic on 9/29/2023 in #front-end
responsive mobile button isnt working
nah bro
49 replies
KPCKevin Powell - Community
Created by epic on 9/29/2023 in #front-end
responsive mobile button isnt working
wait what.. it works in the JS fiddle
49 replies
KPCKevin Powell - Community
Created by epic on 9/29/2023 in #front-end
responsive mobile button isnt working
or smth else
49 replies
KPCKevin Powell - Community
Created by epic on 9/29/2023 in #front-end
responsive mobile button isnt working
of my console?
49 replies
KPCKevin Powell - Community
Created by epic on 9/29/2023 in #front-end
responsive mobile button isnt working
i dont have the code to log it
49 replies
KPCKevin Powell - Community
Created by epic on 9/29/2023 in #front-end
responsive mobile button isnt working
wait
49 replies
KPCKevin Powell - Community
Created by epic on 9/29/2023 in #front-end
responsive mobile button isnt working
its sending just nonthing
49 replies
KPCKevin Powell - Community
Created by epic on 9/29/2023 in #front-end
responsive mobile button isnt working
its the inspect console correct?
49 replies
KPCKevin Powell - Community
Created by epic on 9/29/2023 in #front-end
responsive mobile button isnt working
its sending nothing
49 replies
KPCKevin Powell - Community
Created by epic on 9/29/2023 in #front-end
responsive mobile button isnt working
i might have to use a different tutoiral if this does not work
49 replies