Skip to content

Instantly share code, notes, and snippets.

@blueridgemountains1
Created April 25, 2018 15:44
Show Gist options
  • Save blueridgemountains1/bfc3994afb4386db105f607b840574bb to your computer and use it in GitHub Desktop.
Save blueridgemountains1/bfc3994afb4386db105f607b840574bb to your computer and use it in GitHub Desktop.
Check for Touch or mouse
document.documentElement.addEventListener("mouseover", (el) => {
document.documentElement.classList.add("is-mouse");
});
document.documentElement.addEventListener("touchstart", (el) => {
document.documentElement.classList.add("is-touch");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment