Queryselector all doesn’t work
-
hello @oceanwp, i’m using this piece of js ->
function initUpdateNavbarOnScroll() { var navbarc = document.querySelectorAll('#site-navigation-wrap .dropdown-menu>li>a.menu-link>span'); window.addEventListener('scroll', () => { if (window.scrollY >= window.innerHeight) { navbarc.classList.add('darklinker'); } else { navbarc.classList.remove('darklinker'); } }); } initUpdateNavbarOnScroll();
But the
querySelectorAll('')
doesn’t work versus thequerySelector('')
who’s working. Do you have some possible approach to fix it ?
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Queryselector all doesn’t work’ is closed to new replies.