Skip to content

Instantly share code, notes, and snippets.

@gladchinda
Created July 30, 2018 23:47
Show Gist options
  • Select an option

  • Save gladchinda/0bc2d03a8e4fee330139179e11142d34 to your computer and use it in GitHub Desktop.

Select an option

Save gladchinda/0bc2d03a8e4fee330139179e11142d34 to your computer and use it in GitHub Desktop.
// Using arrow function for event listener
ScrollController.prototype.registerScrollHandler = function() {
this.element.addEventListener('scroll', event => {
if (window.scrollY === this.offsets.offsetY) {
console.log(`${this.offsets.offsetY}px`);
}
}, false);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment