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

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

github - Git errors while pushing -

java - Generating a pre-signed PUT url for Amazon S3 with a maximum content-length -