fix console error

master
Aevann1 2022-11-26 07:34:50 +02:00
parent 86b352d301
commit a8c6daa431
1 changed files with 12 additions and 8 deletions

View File

@ -180,14 +180,18 @@ function smoothScrollTop()
}
// Click navbar to scroll back to top
document.getElementsByTagName('nav')[0].addEventListener('click', (e) => {
if (e.target.id === "navbar" ||
e.target.classList.contains("container-fluid") ||
e.target.id == "navbarResponsive" ||
e.target.id == "logo-container" ||
e.target.classList.contains("srd"))
smoothScrollTop();
}, false);
const nav = document.getElementsByTagName('nav')
if (nav) {
nav[0].addEventListener('click', (e) => {
if (e.target.id === "navbar" ||
e.target.classList.contains("container-fluid") ||
e.target.id == "navbarResponsive" ||
e.target.id == "logo-container" ||
e.target.classList.contains("srd"))
smoothScrollTop();
}, false);
}
// Dynamic shadow when the user scrolls
document.addEventListener('scroll',function (event) {