Skip to content

Instantly share code, notes, and snippets.

@artzub
Created January 10, 2021 06:02
Show Gist options
  • Save artzub/b4d0ea1b387848ab406f85f89d4a268e to your computer and use it in GitHub Desktop.
Save artzub/b4d0ea1b387848ab406f85f89d4a268e to your computer and use it in GitHub Desktop.
document.addEventListener('focus', onFocus, true);
document.addEventListener('blur', onBlur, true);
document.addEventListener('pointerenter', onFocus, true);
document.addEventListener('pointerleave', onBlur, true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment