I made a fixed navigation bar header that when I press the buttons it goes to certain point of my page, but it doesn't considers its own height I mean:
I searched, but didn't found the answer, I even tried manually move it in a desesperation attempt:
let buttons = document.querySelectorAll('.navigation a');
let func = () => {
setTimeout(() => {
window.scrollY = window.scrollY + header.offsetHeight
}, 1000);
}
buttons.forEach((element) => {
element.addEventListener("click", func)
});
but didn't work either, how can I do it?