Created
April 19, 2020 07:12
-
-
Save BluePraise/9fa7c3651b1f25ba43f33582ab3dcce4 to your computer and use it in GitHub Desktop.
Console.log scroll event
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* because I keep forgetting and having to google it */ | |
window.onscroll=function(){ | |
console.log( | |
'top: ' + (window.pageYOffset || document.documentElement.scrollTop) + ' ' + | |
'left: ' + (window.pageXOffset || document.documentElement.scrollLeft) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment