javascript - window.scrollY not working -


i've been working on javascript website , made little test program. when check console, rather getting value of window.scrolly(y) "0" in console. use firefox, in case matter how. here code:

var y = window.scrolly;  console.log(y); print("foo");  window.onscroll=function(event){      console.log(y); }  // used c#, made function                 -  function print(word){      console.log(word); } 

i'm not sure i'm doing generate error, appreciate if got answer.

you're calling print() before declared it. may source of error. try removing line see if error goes away.


Comments

Popular posts from this blog

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

matlab - error with cyclic autocorrelation function -

php - Using grpc in Laravel, "Class 'Grpc\ChannelCredentials' not found." -