I have a problem with the ().scrollTop() function. I want to check if the body of my html is scrolled. I have tried this code:
p = $('body').scrollTop();
console.log(p);
also instead of the ('body') in the selector I tried (document.body), ("#ID").
Problem is, that in the console i always get a return value of "null" instead of "0". I tried the same with (window), then it returns "0" and works fine. But in my case I can not use (window) because I have to set the overflow of html to hidden. The body of the document is scrollable and has height/width 100%, so I dont understand why it is not working..
Thanks a lot for your help!!