Skip to content

Instantly share code, notes, and snippets.

@lmiller1990
Created December 7, 2019 08:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lmiller1990/571672f2220d2ac528b32ce8f999145e to your computer and use it in GitHub Desktop.
Save lmiller1990/571672f2220d2ac528b32ce8f999145e to your computer and use it in GitHub Desktop.
mounted() {
this.progressStartMarker = document.querySelector<HTMLElement>('#progress-marker-start')
this.progressEndMarker = document.querySelector<HTMLElement>('#progress-marker-end')
if (!this.progressStartMarker || !this.progressEndMarker) {
throw Error('Progress markers not found')
}
window.addEventListener('scroll', () => {
this.getScrollPercentage(this.progressStartMarker!, this.progressEndMarker!)
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment