I have been working on a collision detector and I got a problem: when I write a window.scrollY to the console, it gives different values, although I just keep refreshing the page and dont scroll at all. The same is for getBoundingClientRect()
What I tried so far is putting the whole code into DOMContentLoaded listener on the document, which didnt solve this problem at all.
I would be really grateful to anyone who tryes to help me 🙂