Skip to content

Instantly share code, notes, and snippets.

@tonysaffo
Last active January 15, 2018 10:58
Show Gist options
  • Save tonysaffo/2f85ed57f698af23d79b9e806a76936a to your computer and use it in GitHub Desktop.
Save tonysaffo/2f85ed57f698af23d79b9e806a76936a to your computer and use it in GitHub Desktop.
function - amount of scrolled pixels
window.onscroll = function() {
var scrolled = window.pageYOffset || document.documentElement.scrollTop;
document.getElementById('showScroll').innerHTML = scrolled + 'px';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment