I’m trying to understand how the scroll events work in js, and wrote this simple code to see if when I scroll down the webpage I get notified in the console:
I think you do, because there’s nothing wrong with the script.
Is your script linked correctly? Can you console log something at all?
Also, your page does have a scrollbar, right?
I think it is linked correctly because other js functions are able to load and console.log properly… I am just testing this out because I want to do something with the scroll event eventually and thought I’d start with the basic step.
I will have to try and figure this out Thanks.
Yes the below worked! So it means the event listener works but not onscroll…
That’s weird because in a different place in my code I have used the onscroll and it works… JS is so confusing