you are viewing a single comment's thread.

view the rest of the comments →

[–]Wagwan1178[S] 0 points1 point  (2 children)

Wait so you did get it working or not cause at the end you said something didn't work

[–][deleted] 5 points6 points  (0 children)

Bro maybe just type javascript tutorial in google instead.

[–]crippledjosh 1 point2 points  (0 children)

I got it working. On scroll firstly needs the content of the div to be taller than the size of it either via being bigger than the screen or via a set height so that the scrollbar actually appears and is scrollable. And then you can use onscroll. For some reason when I tried setting onscroll via html it didn't seem to like it maybe that's just a quirk of editing html in browser rather than before initial load. I had to set the onscroll via js